Documentation Home
MySQL 8.0 Reference Manual
Related Documentation Download this Manual
PDF (US Ltr) - 32.9Mb
PDF (A4) - 32.9Mb
PDF (RPM) - 30.9Mb
HTML Download (TGZ) - 7.9Mb
HTML Download (Zip) - 7.9Mb
HTML Download (RPM) - 6.7Mb
Man Pages (TGZ) - 143.7Kb
Man Pages (Zip) - 203.9Kb
Info (Gzip) - 3.0Mb
Info (Zip) - 3.0Mb


MySQL 8.0 Reference Manual  /  ...  /  mysql_secure_installation — Improve MySQL Installation Security

Pre-General Availability Draft: 2017-08-16

4.4.2 mysql_secure_installation — Improve MySQL Installation Security

This program enables you to improve the security of your MySQL installation in the following ways:

  • You can set a password for root accounts.

  • You can remove root accounts that are accessible from outside the local host.

  • You can remove anonymous-user accounts.

  • You can remove the test database (which by default can be accessed by all users, even anonymous users), and privileges that permit anyone to access databases with names that start with test_.

mysql_secure_installation helps you implement security recommendations similar to those described at Section 2.9.4, “Securing the Initial MySQL Account”.

Normal usage is to connect to the local MySQL server; invoke mysql_secure_installation without arguments:

shell> mysql_secure_installation

When executed, mysql_secure_installation prompts you to determine which actions to perform.

The validate_password plugin can be used for password strength checking. If the plugin is not installed, mysql_secure_installation prompts the user whether to install it. Any passwords entered later are checked using the plugin if it is enabled.

Most of the usual MySQL client options such as --host and --port can be used on the command line and in option files. For example, to connect to the local server over IPv6 using port 3307, use this command:

shell> mysql_secure_installation --host=::1 --port=3307

mysql_secure_installation supports the following options, which can be specified on the command line or in the [mysql_secure_installation] and [client] groups of an option file. For information about option files used by MySQL programs, see Section 4.2.6, “Using Option Files”.

Table 4.5 mysql_secure_installation Options

FormatDescription
--defaults-extra-fileRead named option file in addition to usual option files
--defaults-fileRead only named option file
--defaults-group-suffixOption group suffix value
--helpDisplay help message and exit
--hostHost to connect to (IP address or host name)
--no-defaultsRead no option files
--passwordAccepted but always ignored. Whenever mysql_secure_installation is invoked, the user is prompted for a password, regardless.
--portTCP/IP port number to use for connection
--print-defaultsPrint default options
--protocolConnection protocol to use
--socketFor connections to localhost, the Unix socket file to use
--ssl-caPath of file that contains list of trusted SSL CAs
--ssl-capathPath of directory that contains trusted SSL CA certificates in PEM format
--ssl-certPath of file that contains X509 certificate in PEM format
--ssl-cipherList of permitted ciphers to use for connection encryption
--ssl-crlPath of file that contains certificate revocation lists
--ssl-crlpathPath of directory that contains certificate revocation list files
--ssl-keyPath of file that contains X509 key in PEM format
--tls-versionProtocols permitted for secure connections
--use-defaultExecute with no user interactivity
--userMySQL user name to use when connecting to server


User Comments
  Posted by Kristian Köhntopp on October 3, 2012
mysql_secure_installation is not just unavailable on Windows, it is also not needed. The GUI installer von Windows offers to perform these post-installation steps, and enabled them even by default.
  Posted by Brian Pete on July 2, 2014
An alternative to the command mysql_secure_installation
http://howtolamp.com/lamp/mysql/5.6/securing/
Sign Up Login You must be logged in to post a comment.