Jump to content

Recommended Posts

Posted

For mysql, you actually do it yourself. In plesk, edit the database user, and there's an option for remote access at the bottom below the permissions section.

Posted

Thanks, I already set this option to "Allow remote connections from any host" and also tried "Allow remote connections from". Both did not work.

I still get the error message:

Quote

Fatal error: Uncaught mysqli_sql_exception: Access denied for user 'lsvcam_webcamLSVdbUser'@'www640.your-server.de' (using password: YES

Code:

$conn = new mysqli(
    "lsvcam.heliohost.us", 
    "lsvcam_webcamLSVdbUser",
    "xxxxxx", 
    "lsvcam_webcamData"
);

if ($conn->connect_error) {
    die(" Verbindung fehlgeschlagen: " . $conn->connect_error);
} else {
    echo " Verbindung erfolgreich hergestellt!<br>";
}v

 

In Plesk, my Database server is:

Database server 
localhost:3306 (default for MariaDB, v10.5.27)

 

Can I change that to "lsvcam.heliohost.us"?

 
Posted

You should be using johnny.heliohost.org as the database server hostname.

Also, the error you're getting makes me think you have the DB settings wrong somewhere else in your code, as it's mentioning  'lsvcam_webcamLSVdbUser'@'www640.your-server.de' If this were set up correctly on your end, that bold part should be showing johnny.heliohost.org.

Posted

Thank you. I just tried several things but was not able to connect.

<?php
error_reporting(E_ALL);
ini_set("display_errors", 1);

echo "<html><head></head><body>";


#$db_host        = '64.62.151.106';
#$db_host        = 'lsvcam.heliohost.us';
$db_host        = 'johnny.heliohost.org';
$db_user        = 'lsvcam_webcamLSVdbUser';
$db_pass        = '-----';
$db_database    = 'lsvcam_webcamData'; 
$db_port        = '3306';

$conn = mysqli_connect($db_host,$db_user,$db_pass,$db_database,$db_port);


// Verbindung prüfen
if ($conn->connect_error) {
    die(" Verbindung fehlgeschlagen: " . $conn->connect_error);
} else {
    echo " Verbindung erfolgreich hergestellt!<br>";
}

// Test-Query
$result = $conn->query("SHOW TABLES");
if ($result) {
    echo "Gefundene Tabellen:<br>";
    while ($row = $result->fetch_array()) {
        echo $row[0] . "<br>";
    }
} else {
    echo " Fehler bei Test-Query: " . $conn->error;
}

$conn->close();
echo "</body></html>";
?>

For all "$db_host", I got the same error message.

in Plesk -> Databases -> User Management -> USER -> Access Control: Allow remote connections from any host
I get the same error when trying to add the IP or www640.your-server.de

 

Acc. to chatgpt, I should ask this ;)
 

Quote

"The MySQL port 3306 of johnny.heliohost.org is accessible from my Hetzner server (IP 168.119.26.120, hostname www640.your-server.de) .
Nevertheless, I receive Access denied for user ‘lsvcam_webcamLSVdbUser’@'www640.your-server.de'.
This means that my user is not enabled for host 168.119.26.120.
Please also create the user as
‘lsvcam_webcamLSVdbUser’@'168.119.26.120'
(or, if necessary, ‘lsvcam_webcamLSVdbUser’@'%') and assign the appropriate rights to the lsvcam_webcamData database.
Example:

GRANT ALL PRIVILEGES ON lsvcam_webcamData.* 
TO ‘lsvcam_webcamLSVdbUser’@'168.119.26.120' IDENTIFIED BY ‘myPassword’;
FLUSH PRIVILEGES;
```”

Any futher ideas? 

Posted

The only other thing it could be is a password issue. I assume you already tried setting a new password for the database user?

Also, maybe Krydos has some insight on this...the settings are correct on your end and in Plesk.

  • Thanks 1
Posted

Thank you! It was a password issue. First I created a ew user, which worked fine. After that, I changes the password on the existing user and it works, too.

Thanks a lot for your support.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...