Jump to Navigation

MySQL: files

This is a list of files you are likely to find in you MySQL data directory (often /var/lib/mysql).

Database files

Within the data directory there will be one subdirectory for each defined database, containing the following files:

  • db.opt: Database options file. One file for each database.
  • TABLE.frm: Table format file. One file for each table.
  • TABLE.MYD: MyISAM data file, containing all table records. One file for each MyISAM table.
  • TABLE.MYI: MyISAM index file. At most one file for each MyISAM table.
  • TABLE.CSV: CSV data file, containing all table records. One file for each CSV table.
  • TABLE.CSM: CSV metadata file, containing table state and number of records. One file for each CSV table.
  • TABLE.IBD: InnoDB data and index file. At most one file for each InnoDB table.

Data directory

Many file names and locations can be set. The defaults displayed below are those of MySQL 6.6 as found compiled on the Oracle website.

  • auto.cnf: server UUID (uniek ID)
  • ibdata*: InnoDB data file, may contain table data too. Location can be set using @@global.innodb_data_home_dir and @@global.innodb_data_file_path.
  • ib_logfile*: InnoDB log files.
  • @@global.log_bin_basename.* (often: mysql66-bin.* or mysqld-bin.*): Binary log files
  • @@global.log_bin_index (often: mysqld-bin.index): Binary log file index.
  • @@global.relay_log_basename.* (often: mysqld-relay-bin.*): Relay log files
  • @@global.relay_log_index (often: mysqld-relay-bin.index): Relay log file index
  • @@global.relay_log_info_file (often: relay-log.info): Slave relay log information
  • @@global.master_info_file (often: master.info): Slave master connection information

Log, socket and PID files

These may have default locations within the datadir or be located elsewhere.

  • @@global.slow_query_log_file (ofen: mysql66-slow.log) Slow query log
  • @@global.general_log_file (often: mysql66.log): General log file
  • @@global.log_error (often: /var/log/mysqld.log): error log
  • @@global.pid_file (often: /var/run/mysqld/mysqld.pid): Process ID of the server process
  • @@global.socket (often: mysql.sock): Socket file to communicate with the MySQL server.
Tags:


Technical_article | by Dr. Radut