Connection configuration for Mysql in PHP

Source: Internet
Author: User
In PHP, if Mysql is used to configure the connection, Mysql will not be installed. if you use an online tutorial, it will generally work.

Http://tech.163.com/06/0206/11/299AMBLT0009159K_3.html

This is quite good.

Configured (mainly

Modify the php. ini file and start some extensions.
Extension = php_gd2.dll
Extension = php_mysql.dll
Extension = php_mysqli.dll
Extension = php_openssl.dll

Note that you can release these items.

)

$ Link = mysql_connect ('localhost', 'root', 'ubing ');
If (! $ Link) echo "failed! ";
Else echo "successful! ";
Mysql_close ();

?>

At this time, it should be no longer reported that mysql_connect cannot find the function.

Phpinfo ();
?>

You can see information about mysql.

At this time, if the above code does not report an error in the web browser, but the web page cannot be displayed, it is tricky.

If you are using Windows 7:

Test libmysql. dll in the php folder to windows \ system32.

(Copy 64-bit to C: \ Windows \ SysWOW64) the problem should be solved.

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.