您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

MySQL增加普通用户后无法登陆问题的解决方法

2025/4/10 11:26:40发布37次查看
今天安装openstack folsom版本,安装完mysql,为各个服务增加对应的数据库和用户后,发现无法使用新增的用户登陆mysql。我增加用
今天安装openstack folsom版本,安装完mysql,,为各个服务增加对应的数据库和用户后,发现无法使用新增的用户登陆mysql。我增加用户的方法如下:
mysql -uroot -p$mysql_pass 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!
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product