mysql - MariaDB grant privilege by using Wildcard host is not working -
i using 5.5.35-mariadb server openstack keystone installation.
below 2 commands used insert privileges user keystone:
grant privileges on keystone.* 'keystone'@'%' identified 'keystone'; grant privileges on keystone.* 'keystone'@'localhost' identified 'keystone'; flush privileges;
but met access deny issue when specify hostname, written in /etc/hosts file. while access using 'localhost' working fine.
[root@controller mariadb]# mysql -ukeystone -pkeystone -hcontroller error 1045 (28000): access denied user 'keystone'@'controller' (using password: yes) [root@controller mariadb]# mysql -ukeystone -pkeystone -hlocalhost welcome mariadb monitor. commands end ; or \g. mariadb connection id 98 server version: 5.5.35-mariadb mariadb server
the workaround me grant privileges host name explicitly, working:
grant privileges on keystone.* 'keystone'@'controller' identified 'keystone';
is normal behavior, since above wildcard host ‘%’ not working??
update
the query result is:
mariadb [(none)]> select user, host mysql.user user = 'keystone'; +----------+-----------+ | user | host | +----------+-----------+ | keystone | % | | keystone | localhost | +----------+-----------+ 2 rows in set (0.00 sec)
and ip address , hostname like:
[root@controller rc]# ip address show mgmt | grep inet inet 10.0.10.101/24 brd 127.255.255.255 scope global mgmt inet6 fe80::a00:27ff:fe9e:6e1a/64 scope link [root@controller rc]# cat /etc/hosts | grep controller 10.0.10.101 controller
user hostname explicitly instead of 'localhost'. fixed 1045 error.
grant privileges on keystone.* 'keystone'@'controller' identified 'keystone';
Comments
Post a Comment