need to connect via php to a remote database (mysql),

When I try to connect, I get an error:

Warning: mysqli_connect() [function.mysqli-connect]: Premature end of data (mysqlnd_wireprotocol.c:553) in Z:\home\q\www\index.php on line 3 Warning: mysqli_connect() [function.mysqli-connect]: OK packet 1 bytes shorter than expected in Z:\home\q\www\index.php on line 3 Warning: mysqli_connect() [function.mysqli-connect]: (HY000/2000): mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication. Please use an administration tool to reset your password with the command SET PASSWORD = PASSWORD('your_existing_password'). This will store a new, and more secure, hash value in mysql.user. If this user is used in other scripts executed by PHP 5.2 or earlier you might need to remove the old-passwords flag from your my.cnf file in Z:\home\q\www\index.php on line 3 

I understand you need to open access to my IP?

Where is it and how is it done?

    1 answer 1

    Judging by the error, the point is not access, but the password in the MySQL database. A hash in the old format is indicated for your account in the database, and the mysqlnd extension, which has been used since PHP 5.3, does not use such hashes.

    To solve your problem, you need to set a password for your account in a new format. To do this in the console of the MySQL server, run:

     SET PASSWORD FOR `ваша_учетная_запись` = PASSWORD("ваш_текущий_пароль"); 

    Or contact the administrator of this server.