October 1, 2015

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

Datapatch Fails in Oracle 12c on Windows – Root Cause and Step-by-Step Fix

   Recently, while applying a patch on an Oracle 12c (12.2.0.1) database on Windows, I ran into a frustrating issue: datapatch kept failin...