Php + mysql5.7 configuration tutorial in Windows, phpmysql5.7

Source: Internet
Author: User

Php + mysql5.7 configuration tutorial in Windows, phpmysql5.7

PHP + MYSQL configuration in WINDOWS

Download mysql

Address: https://dev.mysql.com/downloads/

Click Community.

Click DOWNLOAD

Select the version to download

Click No thanks, just start my download.

Download mysql-5.7.18-winx64.zip

Decompress the package to the root directory of the C drive, change the name to mysql57, enter mysql57, create a txt file, change the name to my. ini, open the file, and add the following configuration information.

[Mysqld] # mysql root directory basedir = C: \ mysql57 # datadir = C: \ mysql57 \ data # port occupied by mysql = 3306

Save and exit
Enter bin, press shift, right-click, and select to open the command window at the current position.

Enter the following code to initialize the database:

mysqld --initialize --user=mysql --console

After the initialization is successful, a random password will be generated for the root account, which is displayed at the end, with 12 characters. Remember to save it.

Enter the following code to install the mysql service.

mysqld --install MYSQL

If the image below is displayed, the installation is successful.

Enter the following code to start mysql

C:\Windows\System32\net start mysql

If the image below is displayed, the startup is successful.

Enter the following code to log on to mysql

mysql -uroot -p

Enter the password after you press Enter. The password is the saved random password. The password may contain spaces and semicolons. Note that the password is entered correctly. Then press Enter. If the following figure is displayed, the logon is successful.

Enter the following code to change the root password.

Set password for root @ localhost = password ('new password ');

The following figure indicates that the password is successfully modified and the Basic installation of mysql has been completed.

Enable mysql extension in php

Open php. ini in the php56 folder.

Find

;extension=php_mysql.dll

Remove the previous; number

Save and exit, restart apache

If mysql extension is displayed in phpinfo, the configuration is successful.

The above is all the content of this article. I hope it will be helpful for your learning and support for helping customers.

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.