您好,登錄后才能下訂單哦!
今天就跟大家聊聊有關mysql中怎么安裝innodb插件,可能很多人都不太了解,為了讓大家更加了解,小編給大家總結了以下內容,希望大家根據這篇文章可以有所收獲。
可以用 show engines;或者show plugins;來查看
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 |
| MRG_MYISAM | ACTIVE | STORAGE ENGINE | NULL | GPL |
| MyISAM | ACTIVE | STORAGE ENGINE | NULL | GPL |
+------------+--------+----------------+---------+---------+
5 rows in set (0.00 sec)
方法一:
在configure的時候加上–with-plugins=innobase (或all) 如果要添多個插件,用半角逗號隔開
方法二:
如果mysql已經編譯好了,又不想重新編譯,可以安裝插件,innodb就是一個插件,安裝好mysql后也是可以添加的。
1,查看一下,mysql配置是不是支持動態添加插件
mysql> show variables like "have_%";
+----------------------+-------+
| Variable_name | Value |
+----------------------+-------+
| have_compress | YES |
| have_crypt | YES |
| have_csv | YES |
| have_dynamic_loading | YES | //在這里是YES表示是支持的
如果是no呢,就不太好辦,因為have_dynamic_loading是只讀變量,
mysql> set have_dynamic_loading=1;
ERROR 1238 (HY000): Variable ‘have_dynamic_loading’ is a read only variable
不過一般情況下都是YES,
2,添加插件
mysql> INSTALL PLUGIN INNODB SONAME 'ha_innodb.so'; //提示打不開文件,沒有權限
ERROR 1126 (HY000): Can't open shared library '/usr/local/mysql/lib/mysql/plugin/ha_innodb.so' (errno: 13 cannot restore segment prot after reloc: Permission denied)
上面報沒有權限錯誤,搞得我很郁悶,解決辦法如下:
# find . -type d -print |grep -i plugin //查看一下插件目錄對不對
./lib/mysql/plugin
# chcon -t texrel_shlib_t /usr/local/mysql/lib/mysql/plugin/ha_innodb.so
chcon: 部分關聯無法應用于文件“/usr/local/mysql/lib/mysql/plugin/ha_innodb.so”
用chcon也報錯,我查一下是因為我沒有安裝selinux
# whereis selinux
selinux:
selinux我根本沒有安裝,如果個人用,這個也不需要,沒辦法裝一下,裝完后chcon就不報錯了。
安裝以下幾個
> install plugin INNODB soname "ha_innodb.so";
mysql> install plugin INNODB_TRX soname "ha_innodb.so";
mysql> install plugin INNODB_LOCKS soname "ha_innodb.so";
mysql> install plugin INNODB_LOCK_WAITS soname "ha_innodb.so";
mysql> install plugin INNODB_CMP soname "ha_innodb.so";
mysql> install plugin INNODB_CMP_RESET soname "ha_innodb.so";
mysql> install plugin INNODB_CMPMEM soname "ha_innodb.so";
mysql> install plugin INNODB_CMPMEM_RESET soname "ha_innodb.so"
安裝好后,在用 show engines;或者show plugins;來查看
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 |
| InnoDB | ACTIVE | STORAGE ENGINE | NULL | GPL |
| INNODB_TRX | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_LOCKS | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_LOCK_WAITS | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_CMP | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_CMP_RESET | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_CMPMEM | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_CMPMEM_RESET | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| MRG_MYISAM | ACTIVE | STORAGE ENGINE | NULL | GPL |
| MyISAM | ACTIVE | STORAGE ENGINE | NULL | GPL |
+---------------------+--------+--------------------+---------+---------+
13 rows in set (0.00 sec)
看完上述內容,你們對mysql中怎么安裝innodb插件有進一步的了解嗎?如果還想了解更多知識或者相關內容,請關注億速云行業資訊頻道,感謝大家的支持。
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。