With the popularization of network, more and more web-based applications are used. The network database is one of them. Through one or several servers can provide services for many customers, this way to bring people a lot of convenience, but also to the outlaws created an opportunity. Because the data is transmitted over the network, this can be intercepted in the process of transmission, or through the very means of access to the database. Because of the above reasons, database security is very important. Therefore, this paper discusses some measures of MySQL database in network security.
Account security
The account is the simplest security measure for MySQL. Each account consists of a user name, a password, and a location (typically a server name, IP, or wildcard character). If user John logs on from Server1, it may be different from John's permission to log on from Server2.
MySQL's user structure is username/password/location. This does not include the name of the database. The following two commands set the Select User rights for Database1 and Database2.
GRANT Select on database1.* to ' abc ' @ ' Server1 ' identified by ' password1 ';
GRANT Select on database2.* to ' abc ' @ ' Server1 ' identified by ' password2 ';
The first command sets the user ABC to use PASSWORD1 when connecting to the database Database1. The second command sets the user ABC to use PASSWORD2 when connecting to the database Database2. As a result, user ABC has a different password to connect to the database Database1 and Database2.
The settings above are very useful. If you only want users to have limited access to one database and not access to other databases, you can set a different password for the same user. If this is not done, it can cause problems when the user discovers that the user name has access to other databases.
MySQL uses a number of authorization tables to track the different permissions of users and those users. These tables are the MyISAM tables in the MySQL database. It makes sense to keep these security messages in MySQL. Therefore, we can use standard SQL to set different permissions.
3 different types of security checks are generally available in the MySQL database:
• Login Verification
This is the most common user name and password validation. Once you have typed in the correct username and password, this validation is available.
• Authorization
After the login is successful, the user is required to set its specific permissions. If you can delete tables in the database, and so on.