码迷,mamicode.com
首页 > 数据库 > 详细

解决Linux下普通用户无法使用root连接MySQL服务

时间:2019-03-20 17:38:12      阅读:246      评论:0      收藏:0      [点我收藏+]

标签:完成   length   res   code   重启   validate   bash   The   sys   

最近在Ubuntu18.04上安装了MySQL5.7.0版本的数据库,按照常规步骤处理完成时候发现使用普通用户(我的是Blue)执行mysql -uroot -p即使密码正确也是连接失败的,因此你可能需要以下操作...

use mysql;
select user, plugin from mysql.user;
select @@validate_password_length;
set global validate_password_length=6;
update mysql.user set authentication_string=PASSWORD(‘123456‘), plugin=‘mysql_native_password‘ where user=‘root‘;
select @@validate_password_length;
select user, plugin from mysql.user;
flush privileges;

重启一下数据库服务:

sudo systemctl restart mysql

解决Linux下普通用户无法使用root连接MySQL服务

标签:完成   length   res   code   重启   validate   bash   The   sys   

原文地址:https://blog.51cto.com/xvjunjie/2366021

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!