1. Download MySQL
- Download MySQL https://www.mysql.com/downloads/on official website, note: Download the MySQL Community server version, download the compressed version
2. Decompression
Unzip the MySQL locally and place it in the corresponding location. I put it in D:\Program Files
3. Environment variables
Right-click on my Computer on the desktop, select Properties-Advanced system settings, Advanced tab, and select environment variables. Click "New" (up and down two new can be, the above new only belongs to the current user, the following new is available to all users), the variable name "Mysql_home", the variable value is the MYSQL directory (the previous level of the bin)
4. Install MySQL Service
1, modify the My.ini (or change the My-default.ini to My.ini, or create a text document to change the name to My.ini), enter My.ini, configuration content
[Mysqld]
Basedir=d:\program files\mysql-5.7.17-winx64
Datadir=d:\program Files\mysql-5.7.17-winx64\data
Port = 3306
Skip-grant-tables
Basedir:mysql installation directory (% mysql_home%)
Datadir:mysql installation directory \data
2, in the MYSQL installation directory (% mysql_home) to create a new folder named data, if you have this folder, the contents of the folder are all deleted
3. Enter the MYSQL installation directory (% mysql_home), and then go to the Bin folder. Open the CMD command-line window (hold down the shift mouse right-click in the folder blank, select "Open command Window Here"), enter mysqld--initialize-insecure--user=mysql clap The carriage return, the "service" in the computer You can find the service of MySQL!
Enter computer service: Right click on "My Computer" on the desktop, select "Manage"--"service and Application"--"service" to find MySQL, if not started, start it
5, enter MySQL, enter Mysql-u root-p on the cmd command line, the root password is empty by default
MySQL installation steps