官网搜索 建议安装5.7版本的
安装建议:
1.尽量不要使用exe
2.尽可能使用压缩包安装(.zip)
1.解压
2.把这个包放到自己的环境目录下
3.配置环境变量 我的电脑 高级 环境变量 把mysql bin目录的路径新增为环境变量
4.新建my.ini 与bin目录同级
[mysqld]
#目录是自己安装的
basedir=D:/huanjing/mysql-5.6.51-winx64/
datadir=D:/huanjing/mysql-5.6.51-winx64/data
port=3306
skip-grant-tables
5.启动管理员模式的CMD,运行所有的命令
6.切换到mysql bin目录下 输入mysqld -install
7.输入 初始化数据库文件
mysqld --initialize-insecure --user=mysql
没有报错,成功
8.启动mysql 设置命令
net start mysql
9.进入mysql -p后面不要有空格
mysql -u root -p
不用输密码,直接回车
10.更改密码
update mysql.user set authentication_string=password('123456') where user='root' and Host='localhost';
输入flush privileges;刷新权限
11.删除my.ini文件最后一句 skip-grant-tables
12.重启mysql exit 退出
net stop mysql
net start mysql