请问windows下用Navicat能连,用PHP无法连接远程mysql的有关问题!

WBOY
Freigeben: 2016-06-13 13:26:51
Original
1139 Leute haben es durchsucht

请教windows下用Navicat能连,用PHP无法连接远程mysql的问题!急!!!

PHP code
<!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->
$user="user_test";
$pass="12345";
$server="172.17.1.15";
$port="3306";
$con=mysql_connect($server,$user,$pass);

Nach dem Login kopieren

PHP版本是 5.3 Mysql版本是 5.077 使用IIS7

显示的是如下错误:
Warning: mysql_connect(): Premature end of data (mysqlnd_wireprotocol.c:554) in D:\WwwRoot\AutoDial\mysql_connect_test.php on line 7 Warning: mysql_connect(): OK packet 1 bytes shorter than expected in D:\WwwRoot\AutoDial\mysql_connect_test.php on line 7 Warning: mysql_connect(): 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 

奇怪的是,使用 navicat可以连接到mysql,但使用代码不行,想请问下该如何解决啊?!谢谢各位了!

------解决方案--------------------
自mysql 4.1开始,不能再用明码的password连接mysql,你上面至少涉及这个问题
Verwandte Etiketten:
Quelle:php.cn
Erklärung dieser Website
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn
Beliebte Tutorials
Mehr>
Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage
Über uns Haftungsausschluss Sitemap
Chinesische PHP-Website:Online-PHP-Schulung für das Gemeinwohl,Helfen Sie PHP-Lernenden, sich schnell weiterzuentwickeln!