Secure initialization of MySQL server

Source: Internet
Author: User

We installed the MySQL server, set up the root user password of MySQL, and then directly began to use, in fact, such a MySQL server there are still some unsafe factors, this article demonstrates with the command mysql_secure_ Installation to safely initialize our MySQL server.

[[email protected] ~]#/usr/bin/mysql_secure_installation
Note:running all PARTS of this SCRIPT are RECOMMENDED for all MySQL
SERVERS in PRODUCTION use! Please READ each STEP carefully!
04
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 would be blank,
Should just press ENTER here.
09
Enter current password to root (enter for none):<---Input the root password now, as we have not set it, go directly
OK, successfully used password, moving on ...
12
Setting The root password ensures that nobody can log into the MySQL
Root user without the proper authorisation.
15
Set root Password? [y/n] Y <---Whether to set the root password, of course set, enter Y return
New Password: <---Enter the root password and enter the process without any display
Re-enter new password: <---Re-enter the root password and enter the process without any display
Password Updated successfully!
Reloading privilege tables.
21st... success!
22
By default, a MySQL installation have an anonymous user, allowing anyone
The log into MySQL without has to has a user account of created for
them. This was intended only for testing, and the installation
Smoother go a bit. You should remove them before moving into a
Production environment.
28
Remove anonymous users? [y/n] Y <---Delete anonymous user, delete, enter y return
30 ... success!
31
Normally, Root should only is allowed to connect from ' localhost '. This
Ensures that someone cannot guess at the root password from the network.
34
Disallow Root login remotely? [y/n] Y <---whether to delete the root user is not allowed to Telnet, of course, enter Y return
36 ... success!
37
Comes by default, MySQL + a database named ' test ' that anyone can
All Access. This was also intended only for testing, and should be removed
Before moving into a production environment.
41
Remove test database and access to it? [y/n] <---whether to delete test database, delete, enter Y return
43-dropping Test Database ...
44 ... success!
45-removing privileges on test database ...
46 ... success!
47
Reloading the privilege tables would ensure that all changes made so far
Effect immediately.
50
Wuyi Reload privilege tables now? [y/n] Y <---refresh permission, enter Y return
52 ... success!
53
Cleaning up ...
55
All done! If you've completed all of the above steps, your MySQL
Installation should now is secure.
58
Thanks for using mysql!

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.