跳过mysql密码验证
编辑/etc/my.cnf
文件,搜索mysqld,在其后任意一行添加 skip-grant-tables
来跳过密码验证。保存并退出。
重启mysql服务
service mysqld restart 或者 systemctl restart mysqld.service
进入mysql
mysql -uroot -p
# 直接按回车,由于mysql5.7版本 user 表中已不存在password字段,现用 authentication_string 代替
update mysql.user set authentication_string=password("root") where user="root";
# 立即生效
flush privileges;