Php and mysql cannot connect to mysql_connect () [function. mysql-connect]: Clientdoesnotsuppor solution

Source: Internet
Author: User
Tags php development environment php mysql
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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.