Grant user access to a database in MySQL command line

To grant access to an user over an existing database on your MySQL server, start the `mysql` command line client and execute the following query:

GRANT ALL PRIVILEGES ON `cloudbalkan_db`.* TO 'cb'@'localhost';

In this query `cloudbalkan_db` is the name of the databases. The `cloudbalkan_db`.* syntax means to grant access on all tables in that database.

If you want to create a new database – check the article “How to create a new database“.

Follow our blog for more MySQL related articles.