An error occurred while connecting to the mysql server using the mysql extension Library in php.

Source: Internet
Author: User
Php failed to use mysql Extension Library to connect to mysql server MySQL extension server

An error always occurs when php uses the mysql extension library to expand the connection to the mysql server. It is said that the page cannot be opened, and no detailed error is reported. if I try it, other errors will be reported! The php. ini file is also configured. You can also see Mysql on the page using the php_info () function. It is hard to understand.
The following is my database connection statement:
$ Link = mysql_connect ("localhost: 3306", "root", "123456 ");
If (! $ Link ){
Die ("error message is". mysql_error ());
}
It is hard to understand. I don't know why.
The following are the configurations in my php. ini file.
Extension_dir = "D:/php/ext"
Extension = php_msql.dll


Reply to discussion (solution)

Extension = php_myql.dll extension open not, open the error message to see.

$ Con = mysql_connect ("localhost", "mysql_user", "mysql_pwd"); if (! $ Con) {die ('could not connect: '. mysql_error ());}

Thank you for reading this. I have installed a mysql server and uninstalled it again. it may be libmysql. dll file problems, I will libmysql. dll and php5ts. the dll file has been copied. in windows/system, restart apache again!

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.