How to Create Root Privileges User Account in MySQL

Do you know that in standard practice, after MySQL database on your server, the very first thing to do is create a password for root account or remove root account and create an account similar to root privileges. We usually do the second action, which is create a root privileges user account and remove root account from MySQL Database.

We are going to show you how to create root privileges account for MySQL database in command line.

1. Login into MySQL database

# mysql -u root

2. Once you have logged into MySQL database in command line, create an account have the similar privilege like root

mysql> GRANT ALL PRIVILEGES ON *.* TO [email protected] IDENTIFIED BY 'whatpasswordisthat' WITH GRANT OPTION;

mysql> flush privileges;

3. Try to login with newly created user

# mysql -u noreplied -p 


Bingo. You have created a new root privileges MySQL user.

Alternatively you can view our video tutorial below.