《MysqL必读MysqL增加新用户无法登陆解决方法》要点:
本文介绍了MysqL必读MysqL增加新用户无法登陆解决方法,希望对您有用。如果有疑问,可以联系我们。
无法使用新增的用户登陆MysqL.我增加用户的方法如下:
MysqL -uroot -p$MysqL_PASS <<EOF
CREATE DATABASE nova;
GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'%' IDENTIFIED BY '$MysqL_PASS';
CREATE DATABASE glance;
GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'%' IDENTIFIED BY '$MysqL_PASS';
CREATE DATABASE keystone;
GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'%'IDENTIFIED BY '$MysqL_PASS';
CREATE DATABASE cinder;
GRANT ALL PRIVILEGES ON cinder.* TO 'cinder'@'%'IDENTIFIED BY '$MysqL_PASS';
CREATE DATABASE quantum;
GRANT ALL PRIVILEGES ON quantum.* TO 'quantum'@'%'IDENTIFIED BY '$MysqL_PASS';
FLUSH PRIVILEGES;
EOF
但使用用户登陆失败:
root@controller:~# MysqL -h localhost -ukeystone -ppassword
ERROR 1045 (28000): Access denied for user 'keystone'@'localhost' (using password: YES)
解决方法:
增加普通用户后,执行:
MysqL> use MysqL
MysqL> delete from user where user='';
MysqL> flush privileges;
意思是删除匿名用户.
OK,搞定,enjoy! 原文链接:https://www.f2er.com/mysql/563754.html