Create a new MySQL user and add the User to a Database

To create a new Database user, you need to run the following command in MySQL terminal

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

To assign the user full privilages to a MySQL database run the following command

GRANT ALL PRIVILEGES ON database_name.* TO 'newuser'@'localhost';

Share this post