About MySQL security from installation

Source: Internet
Author: User

From the installation start to talk about MySQL security when you install MySQL, there will be a prompt: [root @ localhost Desktop] # rpm-ivh MySQL-server-5.5.28-1.rhel5.i386.rpmPreparing... ######################################## ### [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 than *** which will also give you the option of removing the testdatabases and anonymous user created de Fault. this isstronugly 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 has an anonymous user, allowing anyoneto log into MySQL without having to have a user account created forthem. 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 currentpassword for the root user. if you 've just installed MySQL, andyou 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 MySQLroot use R 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 anyoneto log into MySQL without having to have a user account created forthem. this is intended only for testing, and to make the installationgo a bit smoother. you shoshould remove them before moving into aproduction environment. remove anonymous users? [Y/n] y... Success! Normally, root shoshould only be allowed to connect from 'localhost'. Thisensures 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 canaccess. this is also intended only for testing, and shocould be removedbefore 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 farwill 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 MySQLinstallation shoshould now be secure. Thanks for using MySQL!

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.