How to add mysql user manually

It may too easy for the mysql expert out there, it just a simple sharing to the Mysql Amateur user.

If you have SSH, just type “mysql” then you will be in mysql command screen

(1) First create user first

CREATE USER ‘dbuser‘@’localhost’ IDENTIFIED BY ‘password‘;

(2) Assign it to the database

GRANT ALL ON db.* TO ‘dbuser‘@’localhost’;

db: your database name
dbuser: your database username
password: the password

Leave a Reply

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