当我启动 mysql 时,日志文件中出现以下错误。我的默认引擎是 MyIsam,并且我仅对一组 DB 使用 Innodb。
120604 12:24:49 mysqld_safe mysqld from pid file /var/lib/mysql/mysql1.pid1 ended
120604 12:24:58 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
120604 12:24:58 [ERROR] InnoDB: syntax error in innodb_data_file_path
120604 12:24:58 [ERROR] Plugin 'InnoDB' init function returned error.
120604 12:24:58 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
120604 12:24:58 [Note] Event Scheduler: Loaded 0 events
120604 12:24:58 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.1.35-community-log' socket: '/var/lib/mysql/mysql.sock1' port: 3306 MySQL Community Server (GPL)
下面是 InnoDB 表,它给出了未知表引擎“InnoDB”错误?
mysql (mydb) > show create table sitemap;
ERROR 1286 (42000): Unknown table engine 'InnoDB'
我的my.cnf是:
[mysqld]
socket = /var/lib/mysql/mysql.sock1
port = <port>
bind-address = <ip>
pid-file = /var/lib/mysql/mysql1.pid1
datadir = /var/lib/mysql
user = mysql
log-error = /var/lib/mysql/err.log
log-bin=Master-mysql-bin
server-id = 1
ft_min_word_len = 2
skip-show-database
innodb_data_home_dir = /var/lib/mysql
innodb_data_file_path=ibdata1:194.19922M:autoextend
答案1
我之前没有看到过这个错误,但我可以从错误日志中看到:
120604 12:24:58 [ERROR] InnoDB: syntax error in innodb_data_file_path
120604 12:24:58 [ERROR] Plugin 'InnoDB' init function returned error.
120604 12:24:58 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
很明显,您的配置有问题,特别是innodb_data_file_path
值的问题。您可以尝试注释它并重新启动 mysql。如果成功,您可以尝试为此选项找到合适的值。
答案2
在您的 my.cnf 中我看到以下内容:
innodb_data_file_path=ibdata1:194.19922M:autoextend
数字中有一个小数点:194.19922
请将其四舍五入为 194,并将其更改为
innodb_data_file_path=ibdata1:194M:autoextend
并重启mysql