MySQL and PHP connection tutorial steps (GRAPHIC)

Source: Internet
Author: User
Tags php and mysql php mysql
In this article we introduce the integration of PHP with MySQL, since it is integrated with MySQL, then we must first install MySQL. Below we will introduce the installation method of MySQL.

The first step is to download MySQL. Download php to download the latest version of topic.alibabacloud.com download station.

Step two, install the MySQL database

The third step, like installing the Apache method, create the MySQL folder under the phpedu folder, install it under the folder, change the installation directory, click Next

Fourth step, start the installation

Start with this step and click Next.

Until this step, we set up an administrator, set the password here, click Next

Click the arrow to point to continue the installation

Even if the installation is done here

Next we are going to integrate PHP and MySQL, first open the PHP folder in the editor php.ini configuration file, and then the editor to navigate to Extension_dir, on 720 lines, such as:

Next, uncomment the code for the corresponding line, such as:

Here, we need to modify the configuration of MySQL has been modified, the next step is to restart our Apache server. After the database is open, you need to connect, how is php mysql connected? We need to write a piece of code to connect to the database, such as:

Run on the browser and you will see that the connection is successful

Well, here's our database with our PHP integration even if it's done.

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.