Mysql client can be connected, php cannot be connected, please kindly advise

Source: Internet
Author: User
The mysql client can be connected, and php cannot be connected. For more information, please refer to the following code:
The database client can be connected

Php cannot be connected




Reply to discussion (solution)

Didn't the error message tell you?
Call to undefined function mysql_connect ()
The undefined function mysql_connect () is called ()

You have not loaded the php_mysql extension. of course, mysql_connect () is undefined.

I have not changed any of the above.

You should open the mysql remote port again. but I don't know how to open it. can anyone tell me?

You have corrected the php. ini file.
Use phpinfo () to check where php. ini is actually used.

The file address is correct.



I don't know why there are so many good people. why is mobile connection csdn so slow? it's just half a day before I click it. I am in a hurry.

Check whether mysql is available in the phpinfo () result.

Check whether mysql is available in the phpinfo () result.


Mysqli or mysql

Do not take it out of context. you can see the mysqli extension instead of the mysql extension.

Mysql does not have

My hands are cheap.

Mysql extension in php is not enabled
Extension = php_mysql.dll

Mysql extension in php is not enabled
Extension = php_mysql.dll


You can see that I am on the second floor. you just need to open the mysql remote connection, but I won't

Install php_mysql or use mysqli.
Because you have installed mysqli, we recommend that you use mysqli.
Reference: http://www.cnblogs.com/siqi/p/3776577.html

Install php_mysql or use mysqli.
Because you have installed mysqli, we recommend that you use mysqli.
Reference: http://www.cnblogs.com/siqi/p/3776577.html


After writing all the code, use mysqli again.
This does not fundamentally solve the problem.

Not solved yet?
From the #1 command window, we can see:
1. your MySQL version is 5.5
2. your MySQL instance is located in the system search path.
You can try to remove the MySQL PATH from the PATH of the system environment variable or insert the php PATH to the MySQL PATH.
If MySQL5.6 is required, because php cannot use the client of MySQL5.6, you must use the client that you carry.
This problem is very likely to happen to you.

This is one of the reasons why mysql extension is not recommended in php5.5.

Thank you again
It has been solved by overwriting php

Let's take a look at interval _ interval.

Http://blog.csdn.net/u010189941here is the php configuration for configuring mysql. let's take a look!

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.