Documentation Home
MySQL 5.7 Reference Manual
Related Documentation Download this Manual
PDF (US Ltr) - 35.1Mb
PDF (A4) - 35.2Mb
Man Pages (TGZ) - 255.8Kb
Man Pages (Zip) - 360.7Kb
Info (Gzip) - 3.4Mb
Info (Zip) - 3.4Mb
Excerpts from this Manual

Chapter 6 Security

Table of Contents

6.1 General Security Issues
6.1.1 Security Guidelines
6.1.2 Keeping Passwords Secure
6.1.3 Making MySQL Secure Against Attackers
6.1.4 Security-Related mysqld Options and Variables
6.1.5 How to Run MySQL as a Normal User
6.1.6 Security Considerations for LOAD DATA LOCAL
6.1.7 Client Programming Security Guidelines
6.2 Access Control and Account Management
6.2.1 Account User Names and Passwords
6.2.2 Privileges Provided by MySQL
6.2.3 Grant Tables
6.2.4 Specifying Account Names
6.2.5 Access Control, Stage 1: Connection Verification
6.2.6 Access Control, Stage 2: Request Verification
6.2.7 Adding Accounts, Assigning Privileges, and Dropping Accounts
6.2.8 Reserved Accounts
6.2.9 When Privilege Changes Take Effect
6.2.10 Assigning Account Passwords
6.2.11 Password Management
6.2.12 Server Handling of Expired Passwords
6.2.13 Pluggable Authentication
6.2.14 Proxy Users
6.2.15 Account Locking
6.2.16 Setting Account Resource Limits
6.2.17 Troubleshooting Problems Connecting to MySQL
6.2.18 SQL-Based Account Activity Auditing
6.3 Using Encrypted Connections
6.3.1 Configuring MySQL to Use Encrypted Connections
6.3.2 Encrypted Connection TLS Protocols and Ciphers
6.3.3 Creating SSL and RSA Certificates and Keys
6.3.4 SSL Library-Dependent Capabilities
6.3.5 Connecting to MySQL Remotely from Windows with SSH
6.4 Security Plugins
6.4.1 Authentication Plugins
6.4.2 The Connection-Control Plugins
6.4.3 The Password Validation Plugin
6.4.4 The MySQL Keyring
6.4.5 MySQL Enterprise Audit
6.4.6 MySQL Enterprise Firewall
6.5 MySQL Enterprise Data Masking and De-Identification
6.5.1 MySQL Enterprise Data Masking and De-Identification Elements
6.5.2 Installing or Uninstalling MySQL Enterprise Data Masking and De-Identification
6.5.3 Using MySQL Enterprise Data Masking and De-Identification
6.5.4 MySQL Enterprise Data Masking and De-Identification Function Reference
6.5.5 MySQL Enterprise Data Masking and De-Identification Function Descriptions
6.6 MySQL Enterprise Encryption
6.6.1 MySQL Enterprise Encryption Installation
6.6.2 MySQL Enterprise Encryption Usage and Examples
6.6.3 MySQL Enterprise Encryption Function Reference
6.6.4 MySQL Enterprise Encryption Function Descriptions
6.7 SELinux
6.7.1 Check if SELinux is Enabled
6.7.2 Changing the SELinux Mode
6.7.3 MySQL Server SELinux Policies
6.7.4 SELinux File Context
6.7.5 SELinux TCP Port Context
6.7.6 Troubleshooting SELinux

When thinking about security within a MySQL installation, you should consider a wide range of possible topics and how they affect the security of your MySQL server and related applications:

  • General factors that affect security. These include choosing good passwords, not granting unnecessary privileges to users, ensuring application security by preventing SQL injections and data corruption, and others. See Section 6.1, “General Security Issues”.

  • Security of the installation itself. The data files, log files, and the all the application files of your installation should be protected to ensure that they are not readable or writable by unauthorized parties. For more information, see Section 2.9, “Postinstallation Setup and Testing”.

  • Access control and security within the database system itself, including the users and databases granted with access to the databases, views and stored programs in use within the database. For more information, see Section 6.2, “Access Control and Account Management”.

  • The features offered by security-related plugins. See Section 6.4, “Security Plugins”.

  • Network security of MySQL and your system. The security is related to the grants for individual users, but you may also wish to restrict MySQL so that it is available only locally on the MySQL server host, or to a limited set of other hosts.

  • Ensure that you have adequate and appropriate backups of your database files, configuration and log files. Also be sure that you have a recovery solution in place and test that you are able to successfully recover the information from your backups. See Chapter 7, Backup and Recovery.

Note

Several topics in this chapter are also addressed in the Secure Deployment Guide, which provides procedures for deploying a generic binary distribution of MySQL Enterprise Edition Server with features for managing the security of your MySQL installation.