当前位置:Gxlcms > 数据库问题 > Linux启用MySQL的InnoDB引擎

Linux启用MySQL的InnoDB引擎

时间:2021-07-01 10:21:17 帮助过:1人阅读

 

    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/1.sql  
    [root@192.168.1.1]# mysql-5.1.60]#screen -S stou  
    [root@192.168.1.1]# mysql-5.1.60]#automake --force --add-missing  
    [root@192.168.1.1]# mysql-5.1.60]#./configure --prefix=/usr/local/mysql/ --with-plugins=innobase  
    wdcp下安装:  
    [root@192.168.1.1]# mysql-5.1.60]#./configure --prefix=/usr/local/mysql/ --with-plugins=innobase --with-charset=gbk --with-collation=gbk_chinese_ci  

 

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

    mysql.cc:1049: error: expected constructor, destructor, or type conversion before * token  
    mysql.cc: In function int not_in_history(const char*):  
    mysql.cc:2427: error: HIST_ENTRY was not declared in this scope  
    mysql.cc:2427: error: oldhist was not declared in this scope  
    mysql.cc:2427: error: history_get was not declared in this scope  
    mysql.cc: In function void initialize_readline(char*):  
    mysql.cc:2463: error: invalid conversion from char** (*)() to char** (*)(const char*, int, int)  
    mysql.cc:2464: error: invalid conversion from int (*)(const char*, int) to char* (*)(const char*, int)  
    mysql.cc:2465: error: invalid conversion from int (*)() to int (*)(int, int)  
    mysql.cc:2465: error:   initializing argument 2 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:2487: error: completion_matches was not declared in this scope  
    make[2]: *** [mysql.o] Error 1  
    make[2]: Leaving directory `/usr/download/mysql-5.1.60/client  
    make[1]: *** [all] Error 2  
    make[1]: Leaving directory `/usr/download/mysql-5.1.60/client  
    make: *** [all-recursive] Error 1  

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

 

Linux启用MySQL的InnoDB引擎

标签:

人气教程排行