Figure-LAMP
When using LAMP,LAMP SecurityI am worried about the problem, but the problem has been introduced in the previous two articles. Now I will introduce the last one of LAMP security: mysql.
MysqlAspect:
1. Modify the root user password and delete the empty password.
By default, the root user of the installed MySQL instance has a blank password. For security reasons, it must be changed to a strong password. The so-called strong password should be at least 8 characters long, an irregular password consisting of letters, numbers, and symbols. Use the MySQL Command mysaladmin to change the root password. You can also log on to the database and modify the field content of the user table under mysql. The modification method is as follows:
#/Usr/local/mysql/bin/mysqladmin-u root password "upassword" // use mysqladmin
# Mysql> use mysql;
# Mysql> update user set password = password ('upassword') where user = 'root ';
# Mysql> flush privileges; // force refresh the memory authorization table. Otherwise, the password is still cached in the memory.
2. delete default databases and database users
Generally, the MySQL database is installed locally and only needs a local php script to read mysql. Therefore, many users do not need it, especially those installed by default. After MySQL initialization, empty users and test libraries are automatically generated for installation testing. This poses a threat to the security of the database. It is necessary to delete all of them. The final state is only one root, add users and databases as needed.
# Mysql> show databases;
# Mysql> drop database test; // Delete the database test
# Use mysql;
# Delete from db; // delete the table information that stores the database because there is no database information.
# Mysql> delete from user where not (user = 'root'); // delete an initial non-