MySQL Security Configuration Wizard mysql_secure_installation

Source: Internet
Author: User

After installing mysql-server, you will be prompted to run mysql_secure_installation. Running mysql_secure_installation will execute several settings:
A) set a password for the root user
B) Delete anonymous accounts
C. Cancel the remote Logon of the root user.
D) Delete the test database and access permissions to the test database.
E) refresh the authorization table to make the modification take effect.

These settings can improve the security of the mysql database. We recommend that you run mysql_secure_installation once mysql is installed in the production environment. For detailed steps, see the following command:

Copy codeThe Code is as follows:
[Root @ server1 ~] # Mysql_secure_installation
NOTE: running all parts of this script is recommended for all MySQL
Servers in production use! Please read each step carefully!
In order to log into MySQL to secure it, we'll need the current
Password for the root user. If you 've just installed MySQL, and
You haven't set the root password yet, the password will be blank,
So you shoshould just press enter here.
Enter current password for root (enter for none ):
OK, successfully used password, moving on...
Setting the root password ensures that nobody can log into the MySQL
Root user without the proper authorisation.
Set root password? [Y/n] <-whether to set the root user password. Enter y and press ENTER or press Enter.
New password: <-set the password of the root user
Re-enter new password: <-enter your password again
Password updated successfully!
Reloading privilege tables ..
... Success!
By default, a MySQL installation has an anonymous user, allowing anyone
To log into MySQL without having to have a user account created
Them. This is intended only for testing, and to make the installation
Go a bit smoother. You shoshould remove them before moving into
Production environment.
Remove anonymous users? [Y/n] <-whether to delete anonymous users. It is recommended to delete anonymous users in the production environment. Press enter.
... Success!
Normally, root shoshould only be allowed to connect from 'localhost'. This
Ensures that someone cannot guess at the root password from the network.
Disallow root login remotely? [Y/n] <-whether to disable remote root login. Select Y/n as needed and press Enter. We recommend that you disable
... Success!
By default, MySQL comes with a database named 'test' that anyone can
Access. This is also intended only for testing, and shocould be removed
Before moving into a production environment.
Remove test database and access to it? [Y/n] <-whether to delete the test database. Press enter.
-Dropping test database...
... Success!
-Removing privileges on test database...
... Success!
Reloading the privilege tables will ensure that all changes made so far
Will take effect immediately.
Reload privilege tables now? [Y/n] <-whether to reload the permission table. Press enter.
... Success!
Cleaning up...
All done! If you 've completed all of the above steps, your MySQL
Installation shoshould now be secure.
Thanks for using MySQL!
[Root @ server1 ~] #

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.