MySQL Technology Insider-InnoDB storage engine-reading notes (2) as php development, using mysql is always a series of articles blog links http: itsongnetarticles466html Chapter 3 file mysql and innodb file parameters MySQL Technology Insider-InnoDB storage engine-reading notes (2)
Mysql is always indispensable for php development.
Series blog link http://itsong.net/articles/466.html
Chapter 3 files: mysql and innodb file parameter files, configuration paths, initialization parameters, memory size, and other log files, including error logs, binary logs, and slow query logs, query the log socket file, which is required when the unix domain socket and unix domain socket are used for connection. this is generally a local connection, which is faster than the common tcp pid file and the process id file table structure file, stores the file storage engine files defined in the table structure. each storage engine stores files and data, including data and indexes.
* The parameter file musql -- help | grep my. cnf can be used to find the static parameters for loading. The entire instance life cycle cannot be changed, similar to read-only. Dynamic parameters, which can be changed using the set command
SET| [global | session] system_var_name = expr| [@@global. | @@session. | @@]system_var_name = expr
Global and session indicate that the modification is based on the current session or the entire instance lifecycle. Log files Error log: show variables like 'log _ error' to locate the error log. by default, the file name is the server host name. err slow query log. the threshold value is modified through long_query_time. the default value is 10 seconds (meaning more than 10, excluding 10). by default, log_slow_queries is set to ON, mysqldumpslow can solve the problem of too many logs that are difficult to solve from 5.1, and slow queries can be recorded in microseconds. In addition, the slow query will enter the table, called mysql. slow_log: specify log_queries_not_using_indexes through log_output (FILE | TABLE), and record the query logs of slow query log files without indexes. the default FILE name is host name. log, you can also enter the table, general_log binary log, record all the operations that perform changes to the database, excluding SELECT and SHOW operations. Including operation time and execution time. It is mainly used to restore and copy binary files (master and slave real-time synchronization). The show variables like 'datadir 'directory contains the default file name: host name, Suffix: serial number, and bin_log.index: binary index files, by default, the binary log is not enabled, and the binlog performance is reduced by 1%. However, it is acceptable to use mysqlbinlog to view binlogs. There are many operations for binlog, but I am not very concerned about this. Others Socket file, usually in/tmp, mysql. sock pid file, host name. pid, variables is the pid_file table structure definition file, frm suffix file, record table structure definition and view definition, text file, you can directly cat Innodb storage engine file The stored data is stored in tablespaces. by default, a file named ibdata1 with an initial size of 10 MB is created. the default tablespace is used. After the innodb_data_file_path parameter is set, data in the table of the innodb storage engine is recorded in this file. Set innodb_file_per_table. each table based on the innodb storage engine generates a tablespace. The table name is named. ibd, and the default tablespace is not entered. These independent tablespace files only store the table data, index, insert buffer, and other information. the remaining information is stored in the default tablespace. Redo log files Ib_logfile0 and ib_logfile1 record the transaction logs of the innodb storage engine. when each file is written to the end of the file, switch to another log file for writing. for higher reliability, you can set multiple image log groups.