MySQL 8.0 Reference Manual 6.4.5 MySQL Enterprise Audit ....................................................................................... 1465 6.4.6 The Audit Message Component ............................................................................ 1542 6.4.7 MySQL Enterprise Firewall ................................................................................... 1544 6.5 MySQL Enterprise Data Masking and De-Identification ..................................................... 1574 6.5.1 MySQL Enterprise Data Masking and De-Identification Elements ............................ 1576 6.5.2 Installing or Uninstalling MySQL Enterprise Data Masking and De-Identification ....... 1576 6.5.3 Using MySQL Enterprise Data Masking and De-Identification ................................. 1577 6.5.4 MySQL Enterprise Data Masking and De-Identification Function Reference ............. 1583 6.5.5 MySQL Enterprise Data Masking and De-Identification Function Descriptions .......... 1584 6.6 MySQL Enterprise Encryption .......................................................................................... 1593 6.6.1 MySQL Enterprise Encryption Installation .............................................................. 1594 6.6.2 MySQL Enterprise Encryption Usage and Examples .............................................. 1595 6.6.3 MySQL Enterprise Encryption Function Reference ................................................. 1597 6.6.4 MySQL Enterprise Encryption Function Descriptions .............................................. 1597 6.7 SELinux .......................................................................................................................... 1601 6.7.1 Check if SELinux is Enabled ................................................................................ 1602 6.7.2 Changing the SELinux Mode ................................................................................ 1603 6.7.3 MySQL Server SELinux Policies ........................................................................... 1603 6.7.4 SELinux File Context ............................................................................................ 1603 6.7.5 SELinux TCP Port Context ................................................................................... 1605 6.7.6 Troubleshooting SELinux ...................................................................................... 1606 6.8 FIPS Support .................................................................................................................. 1607 7 Backup and Recovery ................................................................................................................ 1611 7.1 Backup and Recovery Types ........................................................................................... 1612 7.2 Database Backup Methods .............................................................................................. 1615 7.3 Example Backup and Recovery Strategy ......................................................................... 1617 7.3.1 Establishing a Backup Policy ................................................................................ 1618 7.3.2 Using Backups for Recovery ................................................................................. 1620 7.3.3 Backup Strategy Summary ................................................................................... 1620 7.4 Using mysqldump for Backups ........................................................................................ 1620 7.4.1 Dumping Data in SQL Format with mysqldump ...................................................... 1621 7.4.2 Reloading SQL-Format Backups ........................................................................... 1622 7.4.3 Dumping Data in Delimited-Text Format with mysqldump ....................................... 1623 7.4.4 Reloading Delimited-Text Format Backups ............................................................ 1624 7.4.5 mysqldump Tips ................................................................................................... 1625 7.5 Point-in-Time (Incremental) Recovery .............................................................................. 1626 7.5.1 Point-in-Time Recovery Using Binary Log .............................................................. 1627 7.5.2 Point-in-Time Recovery Using Event Positions ....................................................... 1628 7.6 MyISAM Table Maintenance and Crash Recovery ............................................................ 1630 7.6.1 Using myisamchk for Crash Recovery ................................................................... 1631 7.6.2 How to Check MyISAM Tables for Errors .............................................................. 1631 7.6.3 How to Repair MyISAM Tables ............................................................................. 1632 7.6.4 MyISAM Table Optimization .................................................................................. 1634 7.6.5 Setting Up a MyISAM Table Maintenance Schedule ............................................... 1635 8 Optimization .............................................................................................................................. 1637 8.1 Optimization Overview ..................................................................................................... 1639 8.2 Optimizing SQL Statements ............................................................................................ 1640 8.2.1 Optimizing SELECT Statements ............................................................................ 1640 8.2.2 Optimizing Subqueries, Derived Tables, View References, and Common Table Expressions .................................................................................................................. 1694 8.2.3 Optimizing INFORMATION_SCHEMA Queries ...................................................... 1708 8.2.4 Optimizing Performance Schema Queries ............................................................. 1711 8.2.5 Optimizing Data Change Statements ..................................................................... 1712 8.2.6 Optimizing Database Privileges ............................................................................. 1714 viii