mysql是否支持innodb的存储类型问题

[复制链接]
查看11 | 回复9 | 2011-2-18 11:42:47 | 显示全部楼层 |阅读模式
查看mysql的存储引擎:
show plugins;
+------------+--------+----------------+--------------+---------+
| Name | Status | Type | Library| License |
+------------+--------+----------------+--------------+---------+
| binlog | ACTIVE | STORAGE ENGINE | NULL | GPL |
| CSV| ACTIVE | STORAGE ENGINE | NULL | GPL |
| MEMORY | ACTIVE | STORAGE ENGINE | NULL | GPL |
| MyISAM | ACTIVE | STORAGE ENGINE | NULL | GPL |
| MRG_MYISAM | ACTIVE | STORAGE ENGINE | NULL | GPL |
| InnoDB | ACTIVE | STORAGE ENGINE | ha_innodb.so | GPL
mysql> show variables like "have_%";
+-------------------------+-------+
| Variable_name | Value |
+-------------------------+-------+
| have_community_features | YES |
| have_compress | YES |
| have_crypt
| YES |
| have_csv
| YES |
| have_dynamic_loading| YES |
| have_geometry | YES |
| have_innodb
| NO|
| have_ndbcluster | NO|
| have_openssl
| NO|
| have_partitioning | NO|
| have_query_cache| YES |
| have_rtree_keys | YES |
| have_ssl
| NO|
| have_symlink
| YES |
第二步:试着安装innodb类型:
INSTALL PLUGIN INNODB SONAME 'ha_innodb.so';
安装成功。创建innodb表也成功。
第三步:修改.cnf的参数
无法启动服务器报:
InnoDB: Error: log file ./ib_logfile0 is of different size 0 5242880 bytes
InnoDB: than specified in the .cnf file 0 536870912 bytes!
1203085:30:24 [ERROR] Plugin 'InnoDB' init function returned error.
1203085:30:24 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.

将 ib_logfile0删除mysqld服务可正常启动。
是不是这样安装的innodb的类型不支持?

回复

使用道具 举报

千问 | 2011-2-18 11:42:47 | 显示全部楼层
innodb启动时会 对log文件的大小进行校验,见下列代码,校验不通过就报你的错误了
611 ret = os_file_get_size(files, &size, &size_high);
614 if (size != srv_calc_low32(srv_log_file_size)
615
|| size_high != srv_calc_high32(srv_log_file_size)) {
616
617
fprintf(stderr,
618
"InnoDB: Error: log file %s is"
619
" of different size %lu %lu bytes\n"
620
"InnoDB: than specified in the .cnf"
621
" file %lu %lu bytes!\n",
622
name, (ulong) size_high, (ulong) size,
623
(ulong) srv_calc_high32(srv_log_file_size),
624
(ulong) srv_calc_low32(srv_log_file_size));
625
626
return(DB_ERROR);
627 }
复制代码
回复

使用道具 举报

千问 | 2011-2-18 11:42:47 | 显示全部楼层
log文件的大小问题,如果要改变日子文件,
1.保证数据页都刷到磁盘
2,修改配置文件
3.转移原备份文件,重新启动mysql
回复

使用道具 举报

千问 | 2011-2-18 11:42:47 | 显示全部楼层
本帖最后由 ha00012 于 2012-3-8 14:56 编辑
devilkin0312 发表于 2012-3-8 12:43
log文件的大小问题,如果要改变日子文件,
1.保证数据页都刷到磁盘
2,修改配置文件

不太明白。。怎么修改log文件的大小?
其实用ll命令看一下,就可以发现ha_innodb.so是ha_innodb.so.0.0.0的链接。。是不是
install plugin INNODB soname "ha_innodb.so.0.0.0";
安装以下几个
mysql> install plugin INNODB soname "ha_innodb_plugin.so.0.0.0";
mysql> install plugin INNODB_TRX soname "ha_innodb_plugin.so.0.0.0";
mysql> install plugin INNODB_LOCKS soname "ha_innodb_plugin.so.0.0.0";
mysql> install plugin INNODB_LOCK_WAITS soname "ha_innodb_plugin.so.0.0.0";
mysql> install plugin INNODB_CMP soname "ha_innodb_plugin.so.0.0.0";
mysql> install plugin INNODB_CMP_RESET soname "ha_innodb_plugin.so.0.0.0";
mysql> install plugin INNODB_CMPMEM soname "ha_innodb_plugin.so.0.0.0";
mysql> install plugin INNODB_CMPMEM_RESET soname "ha_innodb_plugin.so.0.0.0";
重启数据库就可以了?

http://blog.csdn.net/flcandclf/article/details/6852933

回复

使用道具 举报

千问 | 2011-2-18 11:42:47 | 显示全部楼层
ha00012 发表于 2012-3-8 14:52
不太明白。。怎么修改log文件的大小?
其实用ll命令看一下,就可以发现ha_innodb.so是ha_innodb.so.0. ...

mysql> install plugin INNODB soname "ha_innodb.so.0.0.0";
ERROR 1123 (HY000): Can't initialize function 'INNODB'; Plugin initialization function failed.
mysql> install plugin INNODB soname "ha_innodb.so";
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id:3
Current database: *** NONE ***
ERROR 1123 (HY000): Can't initialize function 'INNODB'; Plugin initialization function failed.
回复

使用道具 举报

千问 | 2011-2-18 11:42:47 | 显示全部楼层
如果你是在实验,可直接将日志文件转移到其他目录,然后重启mysql,
回复

使用道具 举报

千问 | 2011-2-18 11:42:47 | 显示全部楼层
devilkin0312 发表于 2012-3-12 16:48
如果你是在实验,可直接将日志文件转移到其他目录,然后重启mysql,

这是线上的服务器。。不是在做实验。。现在因为安装innodb的类型,主从数据都不同步了。。一直报 Last_SQL_Error: Could not execute Update_rows event on table china.repaste_info; Can't find record in 'repaste_info', Error_code: 1032; handler error HA_ERR_KEY_NOT_FOUND; the event's master log sns20-bin.000088, end_log_pos 46899571
一直报,是不是只能将主机上的数据备份之后,导入到从库上
回复

使用道具 举报

千问 | 2011-2-18 11:42:47 | 显示全部楼层
你前面的都是在master中出现的错误?

回复

使用道具 举报

千问 | 2011-2-18 11:42:47 | 显示全部楼层
对之前是主出的错,不支持 innodb类型。现在是从数据有问题。数据不同步!
回复

使用道具 举报

千问 | 2011-2-18 11:42:47 | 显示全部楼层
你有QQ吗?加你的QQ
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行