Home / Technology / IT / Linux / Create a New User and Grant Permissions in MySQL

Create a New User and Grant Permissions in MySQL

To connect to any database with same account, open your connection to your server:

1- Log in to MySQL with the command

mysql -u root -p

2- Type the MySQL root user password.

3- Use the below MySQL command to create the user and do not forget to replace user with the username :

CREATE USER 'user'@'localhost' IDENTIFIED BY 'password';

4- Give the user full access to all databases on server

GRANT ALL PRIVILEGES ON * . * TO 'user'@'localhost';

5- Flush the privileges to see the effect.


6- Now type exit to exit from mysql to your command line or terminal.

About Kalaweeza

Check Also

How to use root account to manage mysql databases

After installing mysql, you need to create an account to manage your databases as descried …

Leave a Reply

Your email address will not be published. Required fields are marked *

Powered by keepvid themefull earn money