win7安装mysql

https://blog.csdn.net/yangguangzhidi/article/details/78540005?locationNum=2&fps=1

1、解压到D盘 

路径:D:\mysql-5.7.20-winx64

2、配置环境变量

变量名:MYSQL_HOME  变量值:D:\mysql-5.7.20-winx64

path 里添加 %MYSQL_HOME%\bin;

有可能报错:登录MySQL5.7时出现ERROR 1045 (28000): Access denied for user 'root'@'localhost'。

因此执行: mysqld -install, 会生成C:\Program Files\MySQL\MySQL Server 5.5/my.ini,配置文件中加入skip-grant-tables,

重启mysql服务。

3、登录mysql,修改root密码

输入命令登录 ,因为之前设置密码为空,所以直接回车登录

输入 命令

update mysql.user set authentication_string = password('111111') where user ='root';

flush privileges;

quit;

退出之后,再次登录就需要输入密码了

输入命令查询root密码情况

4,设置远程登录

grant all privileges on *.* TO 'root'@'%' identified by '111111' with grant option;

flush privileges;
 

猜你喜欢

转载自blog.csdn.net/yangguangmeng/article/details/83050063