mysql5.7-for-windows

2019/11 26 16:11

一、下载mysql5.7
进mysql官网,Downloads/Community/MysqlCommunityServer/
选择老版本 Looking for the latest GA version
二、下载完解压放在一个目录中,例如
D:\mysql-5.7.28-winx64
并创建一个目录
D:\mysql-5.7.28-winx64\data
三、系统变量添加path:D:\mysql-5.7.28-winx64\bin
四、创建D:\mysql-5.7.28-winx64\my.ini,内容如下

[mysqld]
port=3306
basedir=D:/mysql-5.7.28-winx64
datadir=D:/mysql-5.7.28-winx64/data
max_connections=200
character-set-server=utf8
default-storage-engine=INNODB
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
[mysql]
default-character-set=utf8

五、以管理员身份运行cmd
在D:/mysql-5.7.28-winx64/bin目录中
mysqld -install
mysqld –initialize-insecure –user=mysql
net start mysql
六、mysql -u root -p
进去,修改密码
set password for root@localhost = password(‘新密码’);

--转载请注明: http://blog.coolcoding.cn/?p=776