This would seems to prevent attackers who know that a 'root' user exists?

  • Exactly would you imagine to gain from that, in relation to having a solid root password?
    – andol
    Jun 7, 2010 at 4:52
  • Because having to guess a username and password is twice as hard at just guessing the password?
    – Rhubarb
    Jun 7, 2010 at 5:10
  • No, because the username isn't meant to be a secret, hence the system will put much less efforts into hiding/protecting it. If you want to increase the amounts of possible combination you will get a much better effect by simply making your password longer.
    – andol
    Jun 12, 2010 at 19:39

1 Answer 1


Don't remove the MySQL 'root' user, just rename it instead:

mysql> update user set user="somecrazyname" where user="root";
mysql> flush privileges;

I can't rightly imagine what will happen if you go deleting the root user.

  • 1
    It wouldn't make any difference for MySQL if you removed the initial 'root' user but you wouldn't be able to create any more databases/tables etc. if your other users don't have the right privileges.
    – joschi
    Jun 7, 2010 at 7:41
  • 2
    Just a note here, the database must be specified so you would have mysql> update mysql.user set user=...etc Feb 22, 2014 at 15:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.