Mysql test of LAMP Configuration

Source: Internet
Author: User

 

Figure-LAMP

LAMPConfigurationMysqlThe test is as follows:

The above php and Apache have been tested. Next we will test whether the Mysql database has been correctly enabled.

Create mysql_test.php in the/var/www directory:

 
 
  1. $ Link = mysql_connect ("localhost", "root", "020511 ");
  2.  
  3. If (! $ Link)
  4.  
  5. {
  6.  
  7. Die ('could not connect: '. mysql_error ());
  8.  
  9. }
  10.  
  11. Else echo "Mysql has been correctly configured ";
  12.  
  13. Mysql_close ($ link );
  14.  
  15. ?>
  16.  

Save and exit. in the address bar, enter http: // 127.0.0.1/mysql_test.php. If "Mysql has been correctly configured", it indicates OK. If not, restart the Apache server and try again.

Through the article, we can know that the installation of Mysql database is useless. I hope you can use it for future database testing!

  • How to configure Apache in Ubuntu LAMP
  • How to install phpmyadmin-Mysql database management in LAMP
  • Set the read and write permissions for Ubuntu lamp files
  • How to install the LAMP component in Ubuntu
  • LAMP platform environment construction manual
  • Help you build your own lamp Platform
  • Summary of lamp Platform Construction

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.