Php and mysql cannot connect to mysql_connect () [function. mysql-connect]: Clientdoesnotsupporphp cannot be connected to mysql. the error message is as follows: Warning: & nbsp; mysql_connect () & nbsp; [function. mysql-connect]: & nbsp; Client & nbsp php and mysql cannot connect to mysql_connect () [function. mysql-connect]: Client does not suppor
Php and mysql cannot be connected. the error message is as follows:
Warning: mysql_connect () [function. mysql-connect]: Client does not support authentication protocol requested by server; consider upgrading MySQL client
In D: \ XXXX \ apache-tomcat-8.0.5 \ webapps \ Project \ opendb. php on line 5
Cocould not connect: Client does not support authentication protocol requested by server; consider upgrading MySQL client
Php version is php-4.4.9
Myslq version is 5.6
Tomcat version 8.0.5
I want to build a local php development environment (tomcat + mysql + php ).
Now
1. Tomcat and php have been called. you can see phpinfo on the page.
2. tomcat and mysql can also be called. you can use the jsp page to query the table information in mysql.
Note: No solution can be found online. The method below has been tried, and the same error message is returned.
Bytes ----------------------------------------------------------------------------------------------------
The encryption method for connecting to the MySQL account is changed. MySQL 4.1/5.0 is encrypted using PASSWORD. You can solve the problem by using the following two methods:
1) MySQL-> set password for 'some _ user' @ 'some _ host' = OLD_PASSWORD ('New _ password ');
MySQL-> flush privileges;
2) MySQL-> UPDATE MySQL. user SET Password = OLD_PASSWORD ('New _ password') WHERE Host = 'some _ host' AND User = 'some _ user ';
MySQL-> flush privileges;
Bytes ----------------------------------------------------------------------------------------------------
------ Solution --------------------
Background
Starting from php 5.3, php mysql operations only use the built-in mysql client
Obviously, the client version is lower than 5.6, but it does not affect the use
Cause
When you install mysql, the installer adds the installation PATH of mysql to the PATH of the operating system environment variable.
This is the root cause of access failure.
Remedy
So you need to remove the mysql PATH from the PATH
However, jdbc may be unable to connect to mysql, and you may need to reconfigure it.