UPWORK/ODESK guru: Tips and Tricks for clients

skype: upwork.link , email: info@upwork.link

Create root privilege user on MySQL server.

without comments

MySQL root privileges user is “root”, I always remove “root” userid once I got MySQL installed, mainly for security purpose, secondly I do not want stupid thing happened like someone able to brute force into MySQL database.

You can create “root” alike privilege user in MySQL by following the step below:

shell> mysql -u root -p mysql 
mysql> GRANT ALL PRIVILEGES ON *.* TO 'username'@'localhost' \
       IDENTIFIED BY 'password' WITH GRANT OPTION;
mysql> GRANT ALL PRIVILEGES ON *.* TO 'username'@'127.0.0.1' \
       IDENTIFIED BY 'password' WITH GRANT OPTION;
mysql> flush privileges;
mysql> quit;

OR

shell> mysql -u root -p mysql 
mysql> CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';
mysql> GRANT ALL PRIVILEGES ON *.* TO 'username'@'localhost' WITH GRANT OPTION;
mysql> CREATE USER 'username'@'%' IDENTIFIED BY 'password';
mysql> GRANT ALL PRIVILEGES ON *.* TO 'username'@'%' WITH GRANT OPTION;
mysql> flush privileges;
mysql> quit;

You can add a few more privileges user if you have more than 1 person to admin MySQL Database.

Written by spectre

February 14th, 2014 at 12:39 am

Posted in Mysql

Leave a Reply

*