MySQL security issues start with installation

Source: Internet
Author: User

After installing MySQL, you will receive the following prompt:

[Root @ localhost Desktop] # rpm-ivh MySQL-server-5.5.28-1.rhel5.i386.rpm
Preparing... ######################################## ### [100%]
1: mySQL-server ##################################### ###### [100%]


Please remember to set a password for the MySQL root USER!
To do so, start the server, then issue the following commands:

/Usr/bin/mysqladmin-u root password 'new-password'
/Usr/bin/mysqladmin-u root-h localhost. localdomain password 'new-password'


Alternatively you can run:

/Usr/bin/mysql_secure_installation

** For these two methods, I personally think mysql_secure_installation is better ***

Which will also give you the optionRemoving the test
Databases and anonymous user created by default
. This is
Stronugly recommended for production servers.


** I think the key here is to delete anonymous users ***
See the manual for more instructions.

Please report any problems with the/usr/bin/mysqlbug script!


By default, a MySQL installation hasAn anonymous user, Allowing anyone
To log into MySQLWithout having to have a user account created

Them. This is intended only for testing, and to make the installationgo a bit smoother.

You shoshould remove them before moving into a production environment

** Hazards of anonymous users ****

Therefore, you must delete the production environment !!


I chose mysql_secure_installation.


[Root @ localhost Desktop] # 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.

You already have a root password set, so you can safely answer 'n '.

Change the root password? [Y/n] n
... Skipping.

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] y
... 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] n
... Skipping.

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] n
... Skipping.


Reloading the privilege tables will ensure that all changes made so far
Will take effect immediately.


Reload privilege tables now? [Y/n] y
... 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!

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.