这两天在做mysql的性能测试,直接将my-large.cnf的文件覆盖了原先my.cnf(基于my-small.cnf),这其中innodb的参数,如下变化:
bullet:/data/db # diff big_inno.cnf small_inno.cnf
5,7c5,7
< innodb_buffer_pool_size = 256M
< innodb_additional_mem_pool_size = 20M
< innodb_log_file_size = 64M
---
> innodb_buffer_pool_size = 16M
> innodb_additional_mem_pool_size = 2M
> innodb_log_file_size = 5M
然后我就折腾啊折腾,测试啊测试,突然发现有个表竟然是三个文件(MYD,MYI,FRM)的形式存在数据库目录下边
我毕竟是个新手!
mysql> show engines;
+------------+----------+----------------------------------------------------------------+
| Engine | Support | Comment |
+------------+----------+----------------------------------------------------------------+
| MyISAM | DEFAULT | Default engine as of MySQL 3.23 with great performance |
| MEMORY | YES | Hash based, stored in memory, useful for temporary tables |
| InnoDB | DISABLED | Supports transactions, row-level locking, and foreign keys |
| BerkeleyDB | NO | Supports transactions and page-level locking |
| BLACKHOLE | NO | /dev/null storage engine (anything you write to it disappears) |
| EXAMPLE | NO | Example storage engine |
| ARCHIVE | NO | Archive storage engine |
| CSV | NO | CSV storage engine |
| ndbcluster | NO | Clustered, fault-tolerant, memory-based tables |
| FEDERATED | NO | Federated MySQL storage engine |
| MRG_MYISAM | YES | Collection of identical MyISAM tables |
| ISAM | NO | Obsolete storage engine |
+------------+----------+----------------------------------------------------------------+
mysql> show variables like 'have_innodb';
+---------------+----------+
| Variable_name | Value |
+---------------+----------+
| have_innodb | DISABLED |
+---------------+----------+
1 row in set (0.00 sec)
后来发现日志里边有些报错:
Version: '5.0.41' socket: '/tmp/mysql.sock' port: 3306 Source distribution
070625 19:16:29 InnoDB: ERROR: the age of the last checkpoint is 9433987,
InnoDB: which exceeds the log group capacity 9433498.
InnoDB: If you are using big BLOB or TEXT rows, you must set the
InnoDB: combined size of log files at least 10 times bigger than the
InnoDB: largest such row.
070626 09:30:35 mysqld started
InnoDB: Error: log file /data/db/ib_logfile0 is of different size 0 5242880 bytes
InnoDB: than specified in the .cnf file 0 67108864 bytes!
070626 9:30:35 [Note] /usr/local/mysql5.0.41/libexec/mysqld: ready for connections.
Version: '5.0.41-log' socket: '/tmp/mysql.sock' port: 3306 Source distribution
报错也挺明显的,不过也没想到问题所在,我比较笨!
只是怀疑mysql编译的时候是不是innodb没编译进来,还怀疑oracle与mysql的关系是否已经恶化....,显示的加上--with-innodb重新编了,没用
后来也是在http://forums.mysql.com/read.php?10,159210,159291#msg-159291 发现有人跟我有相同的郁闷之处,(他可能更郁闷,他按照手册做了),然后就删除了所有innodb相关文件,连数据文件,重启就可以了。
正确的操作在这里:
http://dev.mysql.com/doc/refman/4.1/en/adding-and-removing.html