我刚刚遇到了我见过我的MySQL守护进程出现的最随机的错误,一切工作正常,然后突然它随机崩溃,现在输出这个,当我启动它,不知道是否因为我的'my.cnf'文件是最小的
这是我的'my.cnf':
[mysqld] # Settings user and group are ignored when systemd is used. # If you need to run mysqld under different user or group, # customize your systemd unit file for mysqld according to the # instructions in http://fedoraproject.org/wiki/Systemd datadir=/var/lib/mysql/ socket=/var/lib/mysql/mysql.sock # Disabling symbolic-links is recommended to prevent assorted security risks symbolic-links=0 [mysqld_safe] log-error=/var/log/mysqld.log pid-file=/var/run/mysqld/mysqld.pid
这是错误:
120817 3:47:26 [Note] Plugin 'FEDERATED' is disabled. 120817 3:47:26 InnoDB: The InnoDB memory heap is disabled 120817 3:47:26 InnoDB: Mutexes and rw_locks use GCC atomic builtins 120817 3:47:26 InnoDB: Compressed tables use zlib 1.2.5 120817 3:47:26 InnoDB: Using Linux native AIO 120817 3:47:26 InnoDB: Initializing buffer pool, size = 128.0M 120817 3:47:26 InnoDB: Completed initialization of buffer pool InnoDB: Error: auto-extending data file ./ibdata1 is of a different size InnoDB: 384 pages (rounded down to MB) than specified in the .cnf file: InnoDB: initial 640 pages, max 0 (relevant if non-zero) pages! 120817 3:47:26 InnoDB: Could not open or create data files. 120817 3:47:26 InnoDB: If you tried to add new data files, and it failed here, 120817 3:47:26 InnoDB: you should now edit innodb_data_file_path in my.cnf back 120817 3:47:26 InnoDB: to what it was, and remove the new ibdata files InnoDB created 120817 3:47:26 InnoDB: in this failed attempt. InnoDB only wrote those files full of 120817 3:47:26 InnoDB: zeros, but did not yet use them in any way. But be careful: do not 120817 3:47:26 InnoDB: remove old data files which contain your precious data! 120817 3:47:26 [ERROR] Plugin 'InnoDB' init function returned error. 120817 3:47:26 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed. 120817 3:47:26 [ERROR] mysqld: unknown variable 'max_used_connections=0' 120817 3:47:26 [ERROR] Aborting 120817 3:47:26 [Note] mysqld: Shutdown complete
任何帮助将不胜感激,谢谢你们! :d
你最好在服务器论坛上询问这个问题,而不是编程论坛?
我认为你可以安全地删除ibdata1文件并重build它们,但要确保重命名 ibdata1文件并重新启动MySQL。 如果失败,请重新命名并转到正确的位置;)
如果可行,运行mysqlcheck( http://dev.mysql.com/doc/refman/5.0/en/mysqlcheck.html )和/或将所有数据导出为SQL(mysqldump),擦除整个数据库,从转储文件导入。
可能是innodb_data_file_path被更改的值。 检查你的/etc/mysql/conf.d/*文件。
如果没有另外指定,默认是
innodb_data_file_path=ibdata1:10M:autoextend