After new clothes mysql_server, need to input mysql_secure_installation set,
Mysql_secure_installation
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS it FOR ALL MySQL
The SERVERS IN PRODUCTION USE. Do READ EACH STEP CAREFULLY!
In order to log into MySQL to secure it, we 'l l need the current
The 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 should just press enter here.
Enter the current password for the root (Enter for none) : & lt; First run directly enter
-OK, successfully informs the password, moving on...
Setting the root password ensures that nobody can log into the MySQL
The root user without the proper authorisation.
Set the root password? [Y/n] <- whether to set the root password, type y and press enter or directly enter
New password: & lt; - set the root password
Re - enter the new password: & lt; - input again you set password
Password updated successfully!
Reloading privilege tables..
... Success!
By default, a MySQL installation from an anonymous user, allowing something
To log into MySQL without having to have a user account created for
Them. This is intended only for testing, and to make the installation
Go a bit smoother. You should remove them before moving into a
Production environment.
Remove anonymous users? [Y/n] <- whether delete anonymous users, production environment suggest to delete, so directly enter
... Success!
Normally, the root should only be allowed to connect the from 'localhost'. This
Ensures that someone always guess at the root password from the network.
Disallow root login remotely? [Y/n] <- whether to ban the root remote login, according to their own needs to choose Y/n and press enter, advised not to
... Success!
By default, MySQL comes with a database named "test" that something can
Access. This is also intended only for testing, and should be removed
Before moving into a production environment.
Remove test database and access to it? [Y/n] <- whether to delete the test database, directly enter
- Dropping test database...
... Success!
- o privileges on the 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 permissions table, directly enter
... Success!
Cleaning up...
All done! If you 've completed all of the above steps, your MySQL
Installation should now be secure.
Thanks for using MySQL!
Assume that, in the process, I mysql password, set for 123456, other all select yes.
How to write a bash script do it?