- 官网下载解压
- mysql-5.7.25-winx64 目录创建my.ini,内容如下
[client]
port=3306
default-character-set=utf8
[mysqld]
# 设置为自己MYSQL的安装目录
basedir=D:\Program Files\mysql-5.7.25-winx64
# 设置为MYSQL的数据目录
datadir=D:\Program Files\mysql-5.7.25-winx64\data
port=3306
character_set_server=utf8
sql_mode=NO_ENGINE_SUBSTITUTION,NO_AUTO_CREATE_USER
#开启查询缓存
explicit_defaults_for_timestamp=true
skip-grant-tables
- 管理员运行cmd到mysql的bin目录下运行
mysqld --initialize-insecure --user=mysql
–user=mysql有空格 - 再运行
mysqld -install
net start mysql
mysql -uroot -p
输入密码直接回车use mysql
grant all privileges on *.* to root@localhost identified by '123456';
flush privileges;