Skip to content Skip to sidebar Skip to footer

How to Create Database User for MySQL



Below commands used for create MySQL user with password.

User Creation
CREATE USER 'theuser'@'localhost' IDENTIFIED BY 'your_password';
CREATE USER 'theuser'@'%' IDENTIFIED BY 'your_password';

Grant Access to the New User
GRANT ALL ON *.* TO 'theuser'@'localhost';
GRANT ALL ON *.* TO 'theuser'@'%';

If you need the user to be able to logged in from remote computer, you may also need to change the bind-address settings in the /etc/mysql/my.cnf or /etc/mysql/mysql.conf.d/mysqld.cnf to the correct one depend on your environment (not localhost or 127.0.0.1).

To confirm it, you can check on which IP and port the services listening to by issuing netstat -tulpn command.




https://stackoverflow.com/questions/15663001/remote-connections-mysql-ubuntu

Post a Comment for "How to Create Database User for MySQL"