Php configures mysql and how to test whether the database is configured successfully

Source: Internet
Author: User
If you configure phpmysqlapache for the first time, how can we test that php is successfully connected to the database? just create a test. php file and save the following code to the file :? Php... if you are configuring php mysql apache for the first time, how can we test that php is successfully connected to the database? just create a test. php file, and then save the following code to the file. the code is as follows:

 

Open http: // localhost/test. php in the browser

If the input is successful, your configuration is successful. if the input fails, you can go to mysql_connect ("localhost", "root", "12345") or die (mysql_error ()); in this way, an error message is displayed.

If the mysql_connect function is not defined, we can use the following in php. ini:

; Extension = php_mysql.dll

; Extension = php_mysqli.dll

Move the previous one.

Extension = php_mysql.dll

Extension = php_mysqli.dll

Restart apache.

Tutorial URL:

You are welcome to add your _ favorites to the Favorites folder, but please keep the link for this 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.