Whenever I used to setup a server, I'd run:

mysql -u root
# Set the root user password for all local domains
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('my_password');
SET PASSWORD FOR 'root'@'localhost.localdomain' = PASSWORD('my_password');
SET PASSWORD FOR 'root'@'127.0.0.1' = PASSWORD('my_password');
# Drop the Any user
DROP USER ''@'localhost';
DROP USER ''@'localhost.localdomain';
# Exit MySQL
exit

Recently I've came across mysql_secure_installation, which seems to do pretty much the same. Can anyone confirm that I am safe to use mysql_secure_installation instead of my code?

link|improve this question

33% accept rate
feedback

1 Answer

up vote 0 down vote accepted

The purpose is to, well, improve the security of your MySQL installation. I always run mysql_secure_installation right after I fire up MySQL.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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