Can't podklyuchitsya to a local database?

Cannot connect to local database, an error 28000/1045
Using phpstorm plugin connected according to this, all good, but the code can't connect to remote database too
March 12th 20 at 08:43
1 answer
March 12th 20 at 08:45
If you use Open Server it is possible you have the wrong port and perhaps somewhere a bug in the code.
1) Check ports.
2) Check the correctness of the entered data.
3) Try to take the code to check the connection.
<?php
$link = mysqli_connect("127.0.0.1", "my_user", "my_password", "my_db");

if (!$link) {
 echo "Error: unable to connect to MySQL." . PHP_EOL;
 echo "error Code errno:" . mysqli_connect_errno() . PHP_EOL;
 echo "error Text error:" . mysqli_connect_error() . PHP_EOL;
exit;
}

echo "MySQL Connection established!" . PHP_EOL;
echo "server Info:" . mysqli_get_host_info($link) . PHP_EOL;

mysqli_close($link);
?>


Here I recommend to download the program for a DB the most powerful in Russian, but still free https://www.devart.com/ru/dbforge/mysql/studio/dow...

Find more questions by tags MySQL