1

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

3
  • 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

6

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.

2
  • 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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .