A few days ago, a team of the company's colleagues responded that the company's internal Linux server MySQL did not innodb this engine, I thought it should not be possible ah, MySQL default should have installed this engine, so on the server to look at, found really not, So putty to the server, show engines looked at:
+------------+---------+ | Engine | Support | +------------+---------+ | CSV | YES | | Mrg_myisam | YES | | MEMORY | YES | | MyISAM | DEFAULT | +------------+---------+
There is no innodb in the list, the first reaction is not to install MySQL when the InnoDB do not compile? But I thought that MySQL should be self-contained, but Google found that a netizen said that because InnoDB is loaded into the MySQL plug-in mode, so you can directly use the Install plugin InnoDB soname ' ha_innodb.so ' To enable InnoDB, but first we need to check to see if we have compiled 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 | +------------+--------+----------------+---------+---------+
But found that there is no plug-in, this can be sure that there is no compile, and then decided to recompile MySQL, of course, before compiling, please back up all the databases, so as not to cause data loss.
[[Email protected]192.168.1.1]# mysqldump--all-database-u root-p >/data0/www/1. sql [[email protected]192.168.1.1]# mysql-5.1. -] #screen-S Stou [[email protected]192.168.1.1]# mysql-5.1. -] #automake--force--add-missing [[email protected]192.168.1.1]# mysql-5.1. -]#./configure--prefix=/usr/local/mysql/--with-plugins=innobase WDCP under installation: [[email protected]192.168.1.1]# mysql-5.1. -]#./configure--prefix=/usr/local/mysql/--with-plugins=innobase--WITH-CHARSET=GBK--with-collation=gbk_chinese_ Ci
But in the end, the following error occurred:
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 declaredinch ThisScope mysql.cc:2427: Error:'oldhist'was not declaredinch ThisScope mysql.cc:2427: Error:'History_get'was not declaredinch ThisScope 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 argument2Of'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 declaredinch ThisScope make[2]: * * * [MYSQL.O] Error1make[2]: Leaving directory '/usr/download/mysql-5.1. -/client'make[1]: * * * [ALL] Error2make[1]: Leaving directory '/usr/download/mysql-5.1. -/client'Make: * * * [all-recursive] Error1
Google found a lot of people have this problem, in fact, to solve this problem only need to be executed before configure:
[Email protected]192.168. 1.1] # Make Clean
Then repeat./configure--prefix=/usr/local/mysql/--with-plugins=innobase and make this step is ready, and then:
[Email protected]192.168. 1.1 ]# make install [[email protected]192.168. 1.1]# service mysqld restart [[email protected]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 Enable success!
Reprint: http://blog.csdn.net/benben0503/article/details/8621015
Linux-enabled MySQL InnoDB engine