前几天公司的一个项目组的同事反应说公司内部的一台Linux服务器上的MySQL没有InnoDB这个引擎,我当时想应该不可能啊,MySQL默认应该 就已经安装了这个引擎的吧,于是上服务器去看了看,发现还真没有,于是putty到服务器上,show engines看了一下:

    +------------+---------+
| Engine | Support |
+------------+---------+
| CSV | YES |
| MRG_MYISAM | YES |
| MEMORY | YES |
| MyISAM | DEFAULT |
+------------+---------+

列表中没有InnoDb,第一反应是不是安装MySQL的时候没有编译InnoDb呢?但心想MySQL应该是自带了的,但google发现有网友说因为InnoDb是以插件的方式加载到MySQL中的,所以可以直接使用install plugin innodb soname 'ha_innodb.so'来启用InnoDB,但首先我们需要查看一下是否已经编译InnoDb:

    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 |
+------------+--------+----------------+---------+---------+

但是发现连插件里面都没有,这下可以确定是没有编译了,于是决定对MySQL重新编译,当然编译前请先备份所有数据库,以免造成数据丢失。

    [root@192.168.1.1]# mysqldump --all-database -u root -p > /data0/www/.sql
[root@192.168.1.1]# mysql-5.1.]#screen -S stou
[root@192.168.1.1]# mysql-5.1.]#automake --force --add-missing
[root@192.168.1.1]# mysql-5.1.]#./configure --prefix=/usr/local/mysql/ --with-plugins=innobase
wdcp下安装:
[root@192.168.1.1]# mysql-5.1.]#./configure --prefix=/usr/local/mysql/ --with-plugins=innobase --with-charset=gbk --with-collation=gbk_chinese_ci

但是最后却出现了以下错误:

    mysql.cc:: error: expected constructor, destructor, or type conversion before '*' token
mysql.cc: In function 'int not_in_history(const char*)':
mysql.cc:: error: 'HIST_ENTRY' was not declared in this scope
mysql.cc:: error: 'oldhist' was not declared in this scope
mysql.cc:: error: 'history_get' was not declared in this scope
mysql.cc: In function 'void initialize_readline(char*)':
mysql.cc:: error: invalid conversion from 'char** (*)()' to 'char** (*)(const char*, int, int)'
mysql.cc:: error: invalid conversion from 'int (*)(const char*, int)' to 'char* (*)(const char*, int)'
mysql.cc:: error: invalid conversion from 'int (*)()' to 'int (*)(int, int)'
mysql.cc:: error: initializing argument of 'int rl_add_defun(const char*, int (*)(int, int), int)'
mysql.cc: In function 'char** new_mysql_completion(const char*, int, int)':
mysql.cc:: error: 'completion_matches' was not declared in this scope
make[]: *** [mysql.o] Error
make[]: Leaving directory `/usr/download/mysql-5.1./client'
make[]: *** [all] Error
make[]: Leaving directory `/usr/download/mysql-5.1./client'
make: *** [all-recursive] Error

Google一下发现不少人都有这个问题,其实解决这个问题只需要在configure前执行一次:

    [root@192.168.1.1]# make clean  

然后再重复./configure --prefix=/usr/local/mysql/ --with-plugins=innobase和make这个步骤就可以了,然后再:

    [root@192.168.1.1]# make install
[root@192.168.1.1]# service mysqld restart
[root@192.168.1.1]# mysql -u root -p
mysql> show engines;
+------------+---------+
| Engine | Support |
+------------+---------+
| CSV | YES |
| MRG_MYISAM | YES |
| MEMORY | YES |
| InnoDB | YES |
| MyISAM | DEFAULT |
+------------+---------+

InnoDB启用成功!

转载:http://blog.csdn.net/benben0503/article/details/8621015

最新文章

  1. python方法中的self
  2. Linux 定时任务 Crontab命令 详解
  3. leetcode刷题全纪录(持续更新)
  4. Rename in Batch [Python]
  5. AFNetworking 基本使用
  6. VMware ESXi客户端连接控制台时提示"VMRC控制台连接已断开...正在尝试重新连接"的解决方法
  7. UIRefreshControl自动刷新
  8. GoF--原型设计模式
  9. kafka.network.SocketServer分析
  10. Injection Attacks-XML注入
  11. java对图片的裁剪(包括来自网络的图片)
  12. 使用react-native做一个简单的应用-06商品界面的实现
  13. OpenProcessToken令牌函数使用方法
  14. 算法模板——平衡树Treap 2
  15. Yii2 Pjax 与 ActionForm ,不刷新提交数据
  16. linux学习(六)绝对路径、相对路径、cd、mkdir、rmdir、rm
  17. 使用GDB命令行调试器调试C/C++程序
  18. Kafka笔记5(内部工作原理)
  19. ThymeLeaf的eclipse插件安装
  20. kafka命令大全

热门文章

  1. ADO.Net的小知识(连接数据库)
  2. Ext.Net 问题收集
  3. Templates
  4. Logstash conf.d 多个配置文件
  5. Vim 的补全模式加速器,轻松玩转全部 15 种自动补全模式
  6. Volatile变量
  7. javascript/jquery给动态加载的元素添加click事件
  8. Ubuntu 修改时间
  9. JDK Tools - wsimport: 编译 WSDL 生成 JAX-WS 规范的 Java 类
  10. 怎样启用SQL SERVER混合身份验证方式