559
Chapter 6. Security
Table of Contents
6.1. General Security Issues ...................................................................................................... 559
6.1.1. Security Guidelines .................................................................................................. 560
6.1.2. Keeping Passwords Secure ..................................................................................... 561
6.1.3. Making MySQL Secure Against Attackers ................................................................. 569
6.1.4. Security-Related
mysqld
Options and Variables ....................................................... 570
6.1.5. How to Run MySQL as a Normal User ..................................................................... 571
6.1.6. Security Issues with
LOAD DATA LOCAL
................................................................. 572
6.1.7. Client Programming Security Guidelines ................................................................... 573
6.2. The MySQL Access Privilege System .................................................................................. 574
6.2.1. Privileges Provided by MySQL ................................................................................. 575
6.2.2. Privilege System Grant Tables ................................................................................. 579
6.2.3. Specifying Account Names ....................................................................................... 583
6.2.4. Access Control, Stage 1: Connection Verification ...................................................... 585
6.2.5. Access Control, Stage 2: Request Verification ........................................................... 588
6.2.6. When Privilege Changes Take Effect ........................................................................ 590
6.2.7. Causes of Access-Denied Errors .............................................................................. 590
6.3. MySQL User Account Management ..................................................................................... 595
6.3.1. User Names and Passwords .................................................................................... 595
6.3.2. Adding User Accounts ............................................................................................. 597
6.3.3. Removing User Accounts ......................................................................................... 600
6.3.4. Setting Account Resource Limits .............................................................................. 600
6.3.5. Assigning Account Passwords .................................................................................. 602
6.3.6. Using SSL for Secure Connections .......................................................................... 603
6.3.7. Connecting to MySQL Remotely from Windows with SSH .......................................... 614
6.3.8. SQL-Based MySQL Account Activity Auditing ............................................................ 614
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.18, “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, “The MySQL Access Privilege System”
, and
Section 6.3, “MySQL
User Account Management”
.
• 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
.
6.1. General Security Issues
This section describes general security issues to be aware of and what you can do to make your
MySQL installation more secure against attack or misuse. For information specifically about the access
Summary of Contents for 5.0
Page 1: ...MySQL 5 0 Reference Manual ...
Page 18: ...xviii ...
Page 60: ...40 ...
Page 396: ...376 ...
Page 578: ...558 ...
Page 636: ...616 ...
Page 844: ...824 ...
Page 1234: ...1214 ...
Page 1427: ...MySQL Proxy Scripting 1407 ...
Page 1734: ...1714 ...
Page 1752: ...1732 ...
Page 1783: ...Configuring Connector ODBC 1763 ...
Page 1793: ...Connector ODBC Examples 1773 ...
Page 1839: ...Connector Net Installation 1819 2 You must choose the type of installation to perform ...
Page 2850: ...2830 ...
Page 2854: ...2834 ...
Page 2928: ...2908 ...
Page 3000: ...2980 ...
Page 3122: ...3102 ...
Page 3126: ...3106 ...
Page 3174: ...3154 ...
Page 3232: ...3212 ...