Page tree
Skip to end of metadata
Go to start of metadata

For cPanel & WHM version 68


The /usr/local/cpanel/scripts/securemysql script secures a cPanel account's MySQL® configuration. To do this, the script performs the following actions:

  • Confirms that MySQL's root password exists.

  • Changes the var/db/mysql and var/lib/mysql directories' ownership to the mysql user.

  • Removes the anonymous and remote root users.
  • Removes the test database.
  • Removes the database's LOCK TABLES and TMP TABLES privileges.

To undo any changes that this script performs, create the /etc/securemysqldisable touch file.

The /usr/local/cpanel/scripts/securemysql script

To use this script, run the following command as the root user:

/usr/local/cpanel/scripts/securemysql [arguments] [actions]


The /usr/local/cpanel/scripts/securemysql script accepts the following arguments:


Specify additional actions in a comma-separated list. For example:

-a removeanon, removeremoteroot



For a list of additional actions, view the Options section below.

Execute the script and do not display the help text.


Display the help message.


Execute the script in silent mode.


You can specify any of the following options in a comma-separated list with the -a argument. 

removeanonRemove any anonymous MySQL users.
removetestdbRemove test database.
removelockntmpRemove global LOCK TABLES permissions and create TMP TABLES privileges.
removeremoterootRemove remote root user login privileges.

Remove insecure Horde login credentials and privileges.




Remove Horde database users that possess blank login passwords.



Additional documentation

There is no content with the specified labels

There is no content with the specified labels

There is no content with the specified labels