Howtos / Articles

Disable remote root logins into MySQL

To keep a MySQL database server secure, you should always only allow root logins from the local machine (localhost, for IPv4, and ::1 for IPv6.

Run the following SQL script against the MySQL server, to remove all access from remote hosts for the ‘root’ user account:

DELETE FROM mysql.user WHERE User='root' AND Host NOT IN ('localhost', '', '::1');

After making changes to permissions/user accounts, make sure you flush the provilege tables using the following command:


Share this howto article!
  • Facebook
  • Twitter
  • Reddit
  • email

Leave a Reply




You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>