Let us know about the program related to MySQL installation mysql_secure_installation −
This program enables users to increase the security of their MySQL installation by:
Users can set a password for the root account.
Users can delete the root account accessed from external localhost.
Users can delete anonymous user accounts.
Users can remove the test database, which is accessible by default to all users (even anonymous users), as well as allow anyone access to databases starting with test_.
mysql_secure_installation helps users implement security recommendations.
Normal usage is to connect to the local MySQL server and then call mysql_secure_installation without parameters. The following is an example:
shell> mysql_secure_installation
When the above statement is executed, mysql_secure_installation will prompt the user to determine what operations need to be performed.
Most commonly used MySQL client options, such as --host and --port, can be used on the command line and in option files. Let us take an example −
To connect to the local server over IPv6, using port 3307, you can use the following command −
shell> mysql_secure_installation --host=::1 --port=3307
mysql_secure_installation supports the following options, which can be found in Specified on the command line or in the [mysql_secure_installation] and [client] groups of the option file.
--host=host_name, -h host_name
It helps to connect to the MySQL server on the given host.
--no-defaults strong>
It does not read any option files. If the program fails to start due to reading unknown options from the options file, you can use the --no-defaults option to prevent them from being read.
--help, -?
It helps to display a help message and exit.
--use-default
It is used for non-interactive execution. This option is available for unattended installation operations.
--user=user_name, -u user_name
is the user name of the MySQL account. Used to connect to the server.
The above is the detailed content of mysql_secure_installation - Improve MySQL installation security. For more information, please follow other related articles on the PHP Chinese website!