十年网站开发经验 + 多家企业客户 + 靠谱的建站团队
量身定制 + 运营维护+专业推广+无忧售后,网站问题一站解决
今天就跟大家聊聊有关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插件有进一步的了解吗?如果还想了解更多知识或者相关内容,请关注创新互联行业资讯频道,感谢大家的支持。