1. Zip:
Https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.20-winx64.zip
2. Official Document Location:
Http://dev.mysql.com/doc/refman/5.7/en/installing.html
3. Extract the files to your favorite location, I extracted to the C: Packing directory
4. Create the My.ini file under the compressed package root directory,
File inside add
[Mysqld]
Port
port=3306
You need to add a character encoding setting (put it under port).
Character-set-server=utf8
Path to file decompression:
Basedir = "c:\\mysql-5.7.20-winx64\\"
Database storage Path:
DataDir = "c:\\mysqldata\\"
Max_allowed_packet = 32M
Configuring Environment variables
- Add a variable called Mysql_home.
- Modify the path variable and add%mysql_home%\bin at the end
5. Run cmd black window as Administrator
C:\mysql-5.7.20-winx64\bin>mysqld install mysql3306--defaults-file= "C:\mysql-5.7.20-winx64\my.ini"
Prompt installation success, Note: mysql3306 is your SQL name, you can change freely, I use mysql3306
6. Execute initialization Statement C:\mysql-5.7.20-winx64\bin>mysqld--initialize no prompt after success
The database you have selected will contain a bunch of files under that folder,
7. Start MySQL
C:\mysql-5.7.20-winx64\bin>net Start mysql3306
The mysql3306 service is starting.
The mysql3306 service has started successfully.
Here is the name of the service you are using when I installed the mysql3306
8. Locate the. Err end file in the file that you just generated, such as:
Open and search password
[Note] A temporary password is generated for [email protected]: yjh6zyx6us>?
The password is: yjh6zyx6us>?
9. Login mysql input command: mysql-u root-p
Password input yjh6zyx6us>?
Note: After mysql5.6, this password is mandatory and must be entered. Search easy must be entered
Enter after entering set password for [email protected] =password (' root ');
Previous line command with semicolon
So it's done.
Login after exiting to connect with root
If you need to configure more than one, configure the second MySQL port number to change it.
Mysql-5.7.20-winx64.zip Zip version, decompression version of MySQL installation