The MySQL Data Directory Note To guarantee crash safety on the replica, you must run the replica with  -- relay-log-recovery  enabled. See also Section 17.2.4, “Relay Log and Replication Metadata Repositories” ). 5. The server shuts down or closes storage engines. 6. The server exits. At this stage, the server flushes the table cache and closes all open tables. Each storage engine performs any actions necessary for tables that it manages.  InnoDB  flushes its buffer pool to disk (unless  innodb_fast_shutdown  is 2), writes the current LSN to the tablespace, and terminates its own internal threads.  MyISAM  flushes any pending index writes for a table. To provide information to management processes, the server returns one of the exit codes described in the following list. The phrase in parentheses indicates the action taken by systemd in response to the code, for platforms on which systemd is used to manage the server. •0 = successful termination (no restart done) •1 = unsuccessful termination (no restart done) •2 = unsuccessful termination (restart done) 5.2 The MySQL Data Directory Information managed by the MySQL server is stored under a directory known as the data directory. The following list briefly describes the items typically found in the data directory, with cross references for additional information: •Data directory subdirectories. Each subdirectory of the data directory is a database directory and corresponds to a database managed by the server. All MySQL installations have certain standard databases: •The  mysql  directory corresponds to the  mysql  system schema, which contains information required by the MySQL server as it runs. This database contains data dictionary tables and system tables. See Section 5.3, “The mysql System Schema” . •The  performance_schema  directory corresponds to the Performance Schema, which provides information used to inspect the internal execution of the server at runtime. See Chapter 27,  MySQL Performance Schema . •The  sys  directory corresponds to the  sys  schema, which provides a set of objects to help interpret Performance Schema information more easily. See Chapter 28,  MySQL sys Schema . •The  ndbinfo  directory corresponds to the  ndbinfo  database that stores information specific to NDB Cluster (present only for installations built to include NDB Cluster). See Section 23.5.14, “ndbinfo: The NDB Cluster Information Database” . Other subdirectories correspond to databases created by users or applications. 1015