mysql5.5 启动报错:ERROR!_MySQL
在FreeBSD中启动mysql时报错,ERROR! The server quit without updating PID file,通常这是可以查看数据库目录下的.err日志,里面会记录一些具体的错误信息,对排错相当有用,内容如下:
110805 17:30:19 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql5.5/data
110805 17:30:19 InnoDB: The InnoDB memory heap is disabled
110805 17:30:19 InnoDB: Mutexes and rw_locks use GCC atomic builtins
110805 17:30:19 InnoDB: Compressed tables use zlib 1.2.3
110805 17:30:19 InnoDB: Initializing buffer pool, size = 256.0M
110805 17:30:19 InnoDB: Completed initialization of buffer pool
InnoDB: Error: log file /usr/local/mysql5.5/data/ib_logfile0 is of different size 0 5242880 bytes
InnoDB: than specified in the .cnf file 0 67108864 bytes!
110805 17:30:19 [ERROR] Plugin 'InnoDB' init function returned error.
110805 17:30:19 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
110805 17:30:19 [ERROR] Unknown/unsupported storage engine: InnoDB
110805 17:30:19 [ERROR] Aborting
110805 17:30:19 [Note] /usr/local/mysql5.5/bin/mysqld: Shutdown complete
看到上面红色字体,显示错误是出在日志文件大小上,于是查看mysql的配置文件/etc/my.cnf
# Uncomment the following if you are using InnoDB tables
innodb_data_home_dir = /usr/local/mysql5.5/data
innodb_data_file_path = ibdata1:10M:autoextend
innodb_log_group_home_dir = /usr/local/mysql5.5/data
# You can set .._buffer_pool_size up to 50 - 80 %
# of RAM but beware of setting memory usage too high
innodb_buffer_pool_size = 256M
innodb_additional_mem_pool_size = 20M
# Set .._log_file_size to 25 % of buffer pool size
innodb_log_file_size = 64M
innodb_log_buffer_size = 8M
innodb_flush_log_at_trx_commit = 1
innodb_lock_wait_timeout = 50
配置文件中指定了innodb_log_file_size=64M,在看看我的数据库目录下,日志文件大小是不是64M,如下图,发现问题了,日志文件是5242880是5M
找到问题了,解决办法可以更改配置文件,也可以删除现在这个日志,再启动mysql这样它会重新生成这两个日志文件。
怎么会出现这个问题呢?
一般来说,是由于,在my.cnf中关于INNODB的一些配置是被注释的,在没有更改的情况下,系统就使用了默认值,这样,当你把关于innodb的配置选项注释去掉的时候,就会出现这个报错!
bitsCN.com推荐阅读
-
安装完MySQL,在配置最后一步报错error Nr.1364
-
mysql-MYSQL登录报错,提示Error 2002
-
mysql启动报错-server PID file could not be found解决_MySQL
-
mysql导入sql文件报错 ERROR 2013 2006 2002_MySQL
-
rhel6 mysql skip-grant-tables 添加用户报错 ERROR 1290
-
mysql5.5中mysqldump: Got error: 1142: SELECT,LOCK TABL com
-
用XAMPP启动MySql时报错--Using innodb_additional_mem_pool_siz_MySQL
-
mysql导入sql文件报错 ERROR 2013 2006 2002_MySQL
-
mysql报错"ERROR 1206 (HY000): The total number of l_MySQL
-
mysql5.5 启动报错:ERROR!_MySQL