1.本地的hosts无法进行localhost及127.0.0.1映射
2.mysql服务端需要修改root的密码及host(忘记密码)
在my.ini中编辑增加一行添加如下内容:
skip-grant-tables #用来跳过密码验证的过程
保存并退出,然后再启动mysql数据库
用UPDATE直接编辑user表
首先登录MySQL。
C:\Users\Administrator>mysql -u root -p -------两次回车后进入mysql5.7
mysql> use mysql;
mysql> update user set authentication_string=password("123456") where user='root'; #其中的"123456"是你需要修改的密码
mysql> flush privileges;
mysql> grant all privileges on *.* to root@'%' identified by '123456' with grant option;
执行时会提示报错信息如下:
ERROR 1290 (HY000): The MySQL server
is
running with the --skip-grant-tables option so it cannot execute
this
statement #没关系不用理会它,继续执行flush privileges;
mysql> flush privileges;
mys