User creation in Mysql where dbname consist hyphen

We can create a user that consists of no special character at ease.

mysql>  create user 'abc'@'localhost' identified by 'redhat';

But to create a user for a database which consists of special character we follow this:-

mysql> grant all privileges on `Emp-Kolkata`.* to soumya@'localhost' identified by 'redhat';

mysql> grant all privileges on `Emp-Kolkata`.* to soumya@'%' identified by 'redhat';

mysql> flush privileges;

So the above command shows how to create a user for a dbname that consists hyphen in it and we granted all privileges to that user for both localhost and remote location.




Please share your ideas and opinions about this topic.

If you like this post, then please share with others.
Please subscribe on email for every updates on mail.

No comments:

Post a Comment