MySQL: How to add a Super User administrator account Tips, Tricks and Tutorials 08 JUL 2015

Sometimes you don’t want to expose your MySQL root user or password to a third party, but do need to give that party access to a super user or administrator account that has full control over the MySQL server instance.

Turns out, to add such a super user account is pretty easy.

First, access your MySQL console with:

mysql -u root -p

Once in, run the following SQL statement:

GRANT ALL PRIVILEGES ON *.* TO myusername@`%` IDENTIFIED BY 'mypassword';

(‘myusername’ and ‘mypassword’ should of course be substituted for your own values. Also, you don’t have to give the account such wide access by exchanging the any host % symbol with a specific IP/host if necessary)

Easy.

child dressed as a powerful superhero, complete with mask and cape

Related Posts:

About Craig Lotter

Software developer, husband and dad to two little girls. Writer behind An Exploring South African. I don't have time for myself any more.