Author: Steven Neiland
Published:

Warning: This blog entry was written two or more years ago. Therefore, it may contain broken links, out-dated or misleading content, or information that is just plain wrong. Please read on with caution.

Step 8: Delete Empty Localhost Users

MySQL creates a set of blank user accounts for localhost. These are not needed and can be a security issue so lets delete them.

First we select the mysql database. We then get a list of all empty localhost users (just to confirm for later). Next we delete the empty user(s), note you will also have an empty user for your machines hostname, so we delete that also. Finally we rerun of select statement to confirm we have deleted them.

mysql> USE mysql;
mysql> SELECT user, host FROM user;
mysql> DELETE FROM user WHERE host='localhost' AND user='';
mysql> DELETE FROM user WHERE host='[hostname]' AND user='';
mysql> SELECT user, host FROM user;

Thats it you can now logout and restart the server to confirm that mysql now starts correctly with the rest of the server.

1 2 3

What Do You Think?

Reader Comments

Post a Comment

Comment Etiquette:

  • Please keep comments on-topic.
  • Please do not post unrelated questions or large chunks of code.
  • Please do not engage in flaming/abusive behaviour.
  • Comments that contain or appear to be advertisments, will not be published.
  • Comments that appear to be created for the purpose of linkbuilding to commercial sites will be removed.

We are all adults here so play nice.

*
*



Archives Blog Listing

Tag Listing

Learn CF In A Week

Treehouse

 
Fork me on GitHub