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.