HostOnNet Blog


Create MySQL User

To create a MySQL user, run

GRANT ALL ON DB_NAME_HERE.* TO 'USER_NAME_HERE'@'localhost' IDENTIFIED BY 'PASSWORD_HERE';

Allow Access to all databases

If you want to allow new user to have access to all database, run

GRANT ALL ON *.* TO 'USER_NAME_HERE'@'localhost' IDENTIFIED BY 'PASSWORD_HERE';

Allow access from Remote Host

To allow access from remote host, create user with

GRANT ALL ON DB_NAME_HERE.* TO 'USER_NAME_HERE'@'REMOTE_HOST_IP_HERE' IDENTIFIED BY 'PASSWORD_HERE';

If you want to allow access from any host, replace REMOTE_HOST_IP_HERE with %.

Create user who can create databases

To create user, who can create his own database and manage them, run

grant create on *.* to 'user'@'localhost' identified by 'pass';
FLUSH PRIVILEGES;

See MySQL


Posted in MySQL