Install MySQL in zip archive under windows

Install MySQL

It is recommended that you use the compressed version, which is fast and convenient to install. Not complicated.

software download

mysql5.7 64-bit download address:

https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.19-winx64.zip

If the computer is 64-bit, download and use the 64-bit version!

installation steps

1. Get the zip compressed package after downloading.

2. Unzip it to the directory you want to install to. I unzip it to D:\Program Files\mysql-5.7

3. Add environment variables: My Computer -> Properties -> Advanced -> Environment Variables

选择PATH,在其后面添加: 你的mysql 安装文件下面的bin文件夹的全路径
D:\Program Files\mysql-5.7\bin

4. Under the mysql installation path D:\Program Files\mysql-5.7(this is my installation path), create and edit the my.ini file

Note here basedirand datadirfollowed by the installation path is the path of your MySQL,datadir 的 data 目录不要创建, 初始化的时候会自动生成

[mysqld]
basedir=D:\Program Files\mysql-5.7\
datadir=D:\Program Files\mysql-5.7\data\
port=3306
skip-grant-tables

5., 启动管理员模式下的CMDand switch the path to mysql下的bin目录, and then enter mysqld –install(install mysql)

6, and then enter the mysqld --initialize-insecure --user=mysqlinitialization data file, there is no error is success

7, starts with the command net start mysqland then use the command mysql –u root –pto enter the mysql management interface (password can be empty) directly enter

8. Change the root password after entering the interface, (123456 below can be changed to your own password)

update mysql.user set authentication_string=password('123456') where user='root' and Host = 'localhost';

9. Refresh permissions

flush privileges;

10. Note the configuration of skipping the password, in the my.ini fileskip-grant-tables

[mysqld]
basedir=D:\Program Files\mysql-5.7\
datadir=D:\Program Files\mysql-5.7\data\
port=3306
# 井号就是注释
#skip-grant-tables

11. Restart mysql to use it normally

net stop mysql
net start mysql

12. The connection test shows the following results and the installation is complete

mysql –u root –p123456

Guess you like

Origin blog.csdn.net/weixin_44953227/article/details/108596835