1. Download MySql Compressed Package

When the download is complete, extract it to the directory where you are going to install it.

2. Set Windows environment variables

Click system > change settings > Advanced > environment variables

Create the MYSQL_HOME variable, whose value is the extracted directory of MySQL.

Modify path variable, and add %MYSQL_HOME%\bin at the end of the value;

3. Initialize MySQL

Open CMD, go to the bin directory in the unzip directory of MySQL, and run:

cd C:\mysql-5.7.20-winx64\bin

mysqld --initialize-insecure --user=mysql

After running, the data directory will be generated in the unzip directory of MySQL.

4. Create my.ini file manually

Create my.ini file in MySQL's decompression directory, and copy the following contents to it for saving.

[client]
port=3306
default-character-set=utf8

[mysqld] 
#Set as your MySQL installation directory 
basedir=C:\mysql-5.7.20-winx64
#Data directory set to MySQL 
datadir=C:\mysql-5.7.20-winx64\data
port=3306
character_set_server=utf8
sql_mode=NO_ENGINE_SUBSTITUTION,NO_AUTO_CREATE_USER
#Turn on query cache
explicit_defaults_for_timestamp=true
skip-grant-tables

5. Install MySQL service

Open CMD, go to the bin directory in the unzip directory of MySQL, and run:

cd C:\mysql-5.7.20-winx64\bin

mysqld -install

The prompt service successfully installed indicates that the installation is successful.

6. Start and stop MySQL service

Next, start MySQL

net start mysql

Stop Mysql

net stop mysql

All Comments

Leave a Reply Cancel Reply

Tips: Your email address will not be disclosed!

If you can't see clearly,please click to change...

Popular Posts

Collections