mariadb - MySQL - Grant access permissions does not work -
i trying give access permissions user specific database in mysql. command not seem take effect.
here's mean:
step 1:
- create db 'testdb'
- grant permissions 'dummyuser'@'%' on testbd.*
- try access mysql testdb user (fails)
root@bnode1 /]# mysql -h 172.22.191.202 -u root -ppassword
mariadb [(none)]> mariadb [(none)]> create database if not exists testdb; query ok, 1 row affected (0.00 sec) mariadb [(none)]> grant privileges on testdb.* 'dummyuser'@'%' identified 'password'; query ok, 0 rows affected (0.00 sec) mariadb [(none)]> flush privileges; query ok, 0 rows affected (0.00 sec) mariadb [(none)]> exit bye [root@bnode1 /]# [root@bnode1 /]# mysql -h 172.22.191.202 -u dummyuser -ppassword error 1045 (28000): access denied user 'dummyuser'@'bnode1' (using password: yes)
on mysql database can see grant priviliges dummyuser below:
mariadb [(none)]> show grants 'dummyuser'; +-----------------------------------------+ | grants dummyuser@% | +-----------------------------------------+ | grant usage on *.* 'dummyuser'@'%' identified password '*2470c0c06dee42fd1618bb99005adca2ec9d1e19' | | grant privileges on `testdb`.* 'dummyuser'@'%' | +-----------------------------------------+ 2 rows in set (0.00 sec)
step 2: tried thing. grant permisson user 'dummyuser'@'bnode1', same commands, , able access.
root@bnode1 /]# mysql -h 172.22.191.202 -u root -ppassword welcome mariadb monitor. commands end ; or \g. ... mariadb [(none)]> grant privileges on testdb.* '**dummyuser'@'bnode1'** identified 'passwor> query ok, 0 rows affected (0.00 sec) mariadb [(none)]> flush privileges; query ok, 0 rows affected (0.00 sec) mariadb [(none)]> exit bye [root@bnode1 /]# [root@bnode1 /]# [root@bnode1 /]# mysql -h 172.22.191.202 -u dummyuser -ppassword welcome mariadb monitor. commands end ; or \g. ... type 'help;' or '\h' help. type '\c' clear current input statement.
i not expert in mysql, can explain me doing wrong.
error 1045 (28000): access denied user 'dummyuser'@'bnode1' (using password: yes)
you may need try connect other host see if 'bnode1' restricted 'dummyuser'
or can create fresh user(as didn't show create user command assume it's existing user) , grant command did should work.
not in case, need ensure 'bind=0.0.0.0' in my.cnf.
Comments
Post a Comment