我在步骤三遇到了问题,所以直接从步骤三开始讲起:
安装Mysql客户端
需要开启mysql服务
查看生成的root密码
最初我认为是“在命令行界面上使用密码可能不安全”导致的,于是我输入命令
这样隐式密码的方式仍不能访问
解决方法:
尝试这个mysql -u root -h 127.0.0.1 -p (enter the random password here)
完美解决!
接下来即可设置root用户的密码set password=password(‘root‘)
grant all privileges on *.* to ‘root‘ @‘%‘ identified by ‘root‘;
flush privileges;
service iptables stop;
原文:https://www.cnblogs.com/sunyu1996/p/14399044.html