PHP ile Uzak Mysql Server bağlantı

1 Cevap

I Aşağıdaki kodu yürütün:

$db_host = "<IP>";  // Host name
$db_user = "<usr>";  // User name of your database
$db_password = "<pass>";     // Password of your database
$db_name="<db name>";   // Database name

$con = mysql_connect($db_host,$db_user,$db_password);
mysql_select_db($db_name) or die("Cannot select database...");

Bu şu hataları gösterir:

Warning: mysql_connect () [function.mysql-connect]: C beklenenden OK paket 6 bayt kısa: \ wamp \ www \ limosbusesjets \ connection.php hat 21

Warning: mysql_connect() [function.mysql-connect]: mysqlnd cannot connect to MySQL 4.1+ using old authentication in C:\wamp\www\limosbusesjets\connection.php on line 21 Cannot select database...

1 Cevap

Bu hatalar genellikle bir PHP 5.3 kullandığı zaman olur, ve yeni mysqlnd driver MySQL (which is often the case with PHP 5.3, as it's one of the new stuff introduced with 5.3 -- and "mysqlnd" is mentionned in your second error) bağlanmak için: olanlar ile, you cannot connect to a MySQL database using the old-passwords system.

Hangi "yeni" kimlik doğrulama sistemine geçmek için, şifreleri ile MySQL sunucu fiyatları biçimini değiştirmek zorundasınız demektir.

Örneğin, bakınız:

Bu durumda soruna neden olduğunu, ama bu, bu hataların için, PHP 5.3 ile, bir ortak MySQL ile ilgili bir şey olduğunu sanmıyorum ...