I faced this problem while doing a deployment. I create a database on the sql server which is running on one machine. Then I wanted to grant access permission to this database from another machine. There are two step process to achieve this
Think you want to grant access permission for 10.0.0.1 machine and your DB server is running on 10.0.0.2 machine
1. Create a user for the remote machine with preferred username and password
mysql> CREATE USER `abcuser`@`10.0.0.1` IDENTIFIED BY 'abcpassword';
Here "abcuser" is the username
"abcpassword" is the password for that user
2. Then grant permission for that user to your database
GRANT ALL PRIVILEGES ON registry.* TO 'abcuser'@'10.0.0.1';
Here "registry" is the DB name
Thats it...............!
vvvdvddvdv
Think you want to grant access permission for 10.0.0.1 machine and your DB server is running on 10.0.0.2 machine
1. Create a user for the remote machine with preferred username and password
mysql> CREATE USER `abcuser`@`10.0.0.1` IDENTIFIED BY 'abcpassword';
Here "abcuser" is the username
"abcpassword" is the password for that user
2. Then grant permission for that user to your database
GRANT ALL PRIVILEGES ON registry.* TO 'abcuser'@'10.0.0.1';
Here "registry" is the DB name
Thats it...............!
vvvdvddvdv
No comments:
Post a Comment