01. 错误日志
错误日志是mysql中最重要的日志之一,它记录了当mysql启动和停止时,以及服务器在运行过程中发生的任何严重错误时的相关信息。当数据库出现任何故障导致无法正常使用时,可以首先查看此日志。
可以用--log_error[=file_name]选项来指定mysqld(mysql服务器)保存错误日志文件的位置。如果没有给定file_name值,mysqld使用错误日志名host_name.err(host_name为知主机名)并默认在参数DATADIR(数据目录)指定的目录中写入日志文件。
[root@ufo128 mysql]# pwd
/var/lib/mysql
[root@ufo128 mysql]# more ufo128.err
191013 12:19:45 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
191013 12:19:45 InnoDB: Initializing buffer pool, size = 8.0M
191013 12:19:45 InnoDB: Completed initialization of buffer pool
InnoDB: The first specified data file ./ibdata1 did not exist:
InnoDB: a new database to be created!
191013 12:19:45 InnoDB: Setting file ./ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
191013 12:19:45 InnoDB: Log file ./ib_logfile0 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile0 size to 5 MB
InnoDB: Database physically writes the file full: wait...
191013 12:19:45 InnoDB: Log file ./ib_logfile1 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile1 size to 5 MB
InnoDB: Database physically writes the file full: wait...
InnoDB: Doublewrite buffer not found: creating new
InnoDB: Doublewrite buffer created
InnoDB: Creating foreign key constraint system tables
InnoDB: Foreign key constraint system tables created
191013 12:19:45 InnoDB: Started; log sequence number 0 0
191013 12:19:45 [Note] Event Scheduler: Loaded 0 events
191013 12:19:45 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.1.73' socket: '/var/lib/mysql/mysql.sock' port: 3306 Source distribution
191013 21:14:07 [Note] /usr/libexec/mysqld: Normal shutdown
191013 21:14:07 [Note] Event Scheduler: Purging the queue. 0 events
191013 21:14:07 InnoDB: Starting shutdown...
191013 21:14:13 InnoDB: Shutdown completed; log sequence number 0 44233
191013 21:14:13 [Note] /usr/libexec/mysqld: Shutdown complete
191013 21:14:13 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended