Installation and configuration method for MySQL 5.7 decompressed version on Windows system.
Published: 2019-03-06
The version installed in this tutorial is 5.7.25.
Download the mysql compressed package and extract it
Download address: http://download.west263.net/%E6%95%B0%E6%8D%AE%E5%BA%93%E8%BD%AF%E4%BB%B6/mysql/mysql5.7.25-win32.zip
Extract to the specified path, e.g. D:\SOFT_PHP_PACKAGE\mysql
Initialize the database
Open a cmd window and enter
d:
cd d:\SOFT_PHP_PACKAGE\mysql\bin
mysqld.exe --initialize --user=mysql --console
After execution is complete, a data folder will be generated in the mysql directory, which contains the mysql database
Note: Record the root password

Configure environment variables
Right-click This PC (Computer) - Properties - Advanced system settings - Advanced - Environment Variables, and add the bin directory to PATH in the system variables
e.g.: D:\SOFT_PHP_PACKAGE\mysql\bin

Install MySQL service
mysqld.exe install MySQL --defaults-file=D:\SOFT_PHP_PACKAGE\mysql\my.ini
If another version of mysql was originally installed and the service name conflicts, you can change the red text MySQL to MySQL5.7
If you have customized the mysql directory, please modify the relevant paths in my.ini
basedir = "D:/SOFT_PHP_PACKAGE/mysql/data/"
datadir = "D:/SOFT_PHP_PACKAGE/mysql/data/"
innodb_data_home_dir = "D:/SOFT_PHP_PACKAGE/mysql/data/"
Create a normal user
Used to start and run mysql; set the username and password yourself
Enter under cmd: net user username password /add
Set mysql directory permissions
Enter under cmd: cacls.exe d:\SOFT_PHP_PACKAGE\mysql /t /e /g mysql:F
Start mysql service
Open Services, find mysql - Log On, select This account, and enter the username and password created in step 5

After setting it up, start the mysql service
Test login
mysql -uroot -p
Enter password: RGd*q%Ip<3Uf
If the content shown in the screenshot appears, the installation is successful

