Off-topic: I haven’t installed mysql for a long time. I bought a new computer today and reinstalled it. It’s really tiring, so I wrote a tutorial to avoid forgetting it in the future.
Enter the formal tutorial below:
Step 1: Download the latest MySQL file and unzip it :
Download the latest version of MySQL–mysql-5.7.12 download
Unzip the downloaded file to your favorite location, for example, my location is D:\MySQL\mysql-5.7.12-winx64
Step 2: Configure environment variables
Not much to say here, just configure the bin directory under the path.
Step 3: Add configuration file
Directly copy the my-default.ini file under the decompression path, rename it to my.ini and edit it The content of this file is as follows:
[mysqld]basedir=D:\MySQL\mysql-5.7.12-winx64\datadir=D:\MySQL\mysql-5.7.12-winx64\data\port=3306
There are two main issues that need to be noted here:
1. basedir is the decompression of your mysql file above path.
2. Create a new empty folder named data under the path, which is datadir.
Step 4: Initialize the database and configure the service
Then executemysqld --initialize --user=mysql --console
After successful execution, after the printed text The last part is the initial password of the database. Remember to copy it, select it with the mouse, press Enter and find a place to ctrl+v.
After completing the above, open CMD as an administrator and execute mysqld --install MySQL
–>Add to System servicenet start mysql
–>Start mysql service
Step 5: Modify mysql Initial password
1. Open CMD and execute: mysql -u root -p
2. Enter what you just entered The initial password for the saved database.
3. Execute set password = password(‘***NewPassword***‘);
Just enter your own new password in the position of NewPassword.
Recommended related articles:
Detailed steps to install MySQL 5.7.12 under CentOS 6.5 (pictures and text)
mysql 5.7.12 win64 Manual installation tutorial steps (pictures and text)
The above is the detailed content of Mysql-5.7.12 decompressed version installation steps tutorial. For more information, please follow other related articles on the PHP Chinese website!