真实的国产乱ⅩXXX66竹夫人,五月香六月婷婷激情综合,亚洲日本VA一区二区三区,亚洲精品一区二区三区麻豆

成都創(chuàng)新互聯(lián)網(wǎng)站制作重慶分公司

Mysql如何在線安裝其它引擎

這篇文章主要介紹MySQL如何在線安裝其它引擎,文中介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們一定要看完!

成都網(wǎng)站建設(shè)哪家好,找成都創(chuàng)新互聯(lián)!專注于網(wǎng)頁(yè)設(shè)計(jì)、成都網(wǎng)站建設(shè)、微信開(kāi)發(fā)、微信小程序、集團(tuán)成都定制網(wǎng)站等服務(wù)項(xiàng)目。核心團(tuán)隊(duì)均擁有互聯(lián)網(wǎng)行業(yè)多年經(jīng)驗(yàn),服務(wù)眾多知名企業(yè)客戶;涵蓋的客戶類型包括:活動(dòng)板房等眾多領(lǐng)域,積累了大量豐富的經(jīng)驗(yàn),同時(shí)也獲得了客戶的一致贊許!

mysql 在線安裝sphinx存儲(chǔ)引擎  


需要在現(xiàn)有mysql中安裝sphinx的存儲(chǔ)引擎,要保證現(xiàn)有mysql運(yùn)行的情況下完成。mysql也的確支持存儲(chǔ)引擎的在線熱插拔,下面介紹安裝步驟:


1、查看現(xiàn)有mysql的運(yùn)行版本

[root@localhost plugin]# mysqladmin  -uroot -proot version  

Warning: Using a password on the command line interface can be insecure.

mysqladmin  Ver 8.42 Distrib 5.6.16, for Linux on x86_64

Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.


Oracle is a registered trademark of Oracle Corporation and/or its

affiliates. Other names may be trademarks of their respective

owners.


Server version          5.6.16

Protocol version        10

Connection              Localhost via UNIX socket

UNIX socket             /var/lib/mysql/mysql.sock

Uptime:                 1 day 6 hours 26 min 58 sec


Threads: 1  Questions: 35  Slow queries: 0  Opens: 67  Flush tables: 1  Open tables: 60  Queries per second avg: 0.000



2、下載mysql和sphinx

mysql:wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.16.tar.gz

sphinx:http://sphinxsearch.com/downloads/release/ 進(jìn)去后下載:

Sphinx 2.1.7-release (r4638; Mar 30, 2014)
Mysql如何在線安裝其它引擎 Source tarball (tar.gz) 2.1.7-release 2.3M Download


注意:mysql源碼包的版本一定要與當(dāng)前運(yùn)行的mysql版本一致!


解壓

# tar -xzvf mysql-5.6.16.tar.gz

# tar -xzvf sphinx-2.1.7-release.tar.gz


3、將sphinx-2.1.7-release下的mysqlse目錄復(fù)制到mysql目錄中

#cp -r sphinx-2.1.7-release/mysqlse/ mysql-5.6.16/storage/sphinx


build

# cd mysql-5.6.16

# sh BUILD/autorun.sh

#./configure (此步可以需要yum一些依賴的軟件包,否則會(huì)有錯(cuò)誤或警告)

# make


注意:這里到make這步即可,不用install


4、將make好的文件復(fù)制到當(dāng)前運(yùn)行的mysql目錄中

[root@localhost sphinx]# pwd

/u/opt/mysql-5.6.16/storage/sphinx

cp ha_sphinx.so /usr/lib64/mysql/plugin/

更改所有者(這邊試不改也可以)

# chown mysql.mysql /usr/lib64/mysql/plugin/*


注:我當(dāng)前運(yùn)行的mysql目錄在/usr/local/mysql


5、登陸mysql加載sphinx引擎模塊

mysql> show engines;

+--------------------+---------+----------------------------------------------------------------+--------------+------+------------+

| Engine             | Support | Comment                                                        | Transactions | XA   | Savepoints |

+--------------------+---------+----------------------------------------------------------------+--------------+------+------------+

| InnoDB             | DEFAULT | Supports transactions, row-level locking, and foreign keys     | YES          | YES  | YES        |

| CSV                | YES     | CSV storage engine                                             | NO           | NO   | NO         |

| MEMORY             | YES     | Hash based, stored in memory, useful for temporary tables      | NO           | NO   | NO         |

| BLACKHOLE          | YES     | /dev/null storage engine (anything you write to it disappears) | NO           | NO   | NO         |

| MRG_MYISAM         | YES     | Collection of identical MyISAM tables                          | NO           | NO   | NO         |

| MyISAM             | YES     | MyISAM storage engine                                          | NO           | NO   | NO         |

| ARCHIVE            | YES     | Archive storage engine                                         | NO           | NO   | NO         |

| FEDERATED          | NO      | Federated MySQL storage engine                                 | NULL         | NULL | NULL       |

| PERFORMANCE_SCHEMA | YES     | Performance Schema                                             | NO           | NO   | NO         |

+--------------------+---------+----------------------------------------------------------------+--------------+------+------------+

9 rows in set (0.01 sec)


mysql> INSTALL PLUGIN sphinx SONAME 'ha_sphinx.so';

ERROR 1126 (HY000): Can't open shared library '/usr/lib64/mysql/plugin/ha_sphinx.so' (errno: 2 /usr/lib64/mysql/plugin/ha_sphinx.so: cannot open shared object file: No such file or directory)

這里ERROR發(fā)現(xiàn)第一次是ha_sphinx.so位置拷錯(cuò)了,拷正確后:

mysql> INSTALL PLUGIN sphinx SONAME 'ha_sphinx.so';

Query OK, 0 rows affected (0.05 sec)


mysql> show engines;

+--------------------+---------+----------------------------------------------------------------+--------------+------+------------+

| Engine             | Support | Comment                                                        | Transactions | XA   | Savepoints |

+--------------------+---------+----------------------------------------------------------------+--------------+------+------------+

| InnoDB             | DEFAULT | Supports transactions, row-level locking, and foreign keys     | YES          | YES  | YES        |

| CSV                | YES     | CSV storage engine                                             | NO           | NO   | NO         |

| MEMORY             | YES     | Hash based, stored in memory, useful for temporary tables      | NO           | NO   | NO         |

| BLACKHOLE          | YES     | /dev/null storage engine (anything you write to it disappears) | NO           | NO   | NO         |

| MRG_MYISAM         | YES     | Collection of identical MyISAM tables                          | NO           | NO   | NO         |

| SPHINX             | YES     | Sphinx storage engine 2.1.7-release                            | NO           | NO   | NO         |

| MyISAM             | YES     | MyISAM storage engine                                          | NO           | NO   | NO         |

| ARCHIVE            | YES     | Archive storage engine                                         | NO           | NO   | NO         |

| FEDERATED          | NO      | Federated MySQL storage engine                                 | NULL         | NULL | NULL       |

| PERFORMANCE_SCHEMA | YES     | Performance Schema                                             | NO           | NO   | NO         |

+--------------------+---------+----------------------------------------------------------------+--------------+------+------------+

10 rows in set (0.00 sec)


mysql> 

安裝完成!如果要卸載存儲(chǔ)模塊使用

mysql> UNINSTALL PLUGIN sphinx;  

安裝好后,過(guò)了幾天:

mysql> show engines;
+--------------------+---------+----------------------------------------------------------------+--------------+------+------------+
| Engine             | Support | Comment                                                        | Transactions | XA   | Savepoints |
+--------------------+---------+----------------------------------------------------------------+--------------+------+------------+
| InnoDB             | DEFAULT | Supports transactions, row-level locking, and foreign keys     | YES          | YES  | YES        |
| CSV                | YES     | CSV storage engine                                             | NO           | NO   | NO         |
| MEMORY             | YES     | Hash based, stored in memory, useful for temporary tables      | NO           | NO   | NO         |
| BLACKHOLE          | YES     | /dev/null storage engine (anything you write to it disappears) | NO           | NO   | NO         |
| MRG_MYISAM         | YES     | Collection of identical MyISAM tables                          | NO           | NO   | NO         |
| MyISAM             | YES     | MyISAM storage engine                                          | NO           | NO   | NO         |
| ARCHIVE            | YES     | Archive storage engine                                         | NO           | NO   | NO         |
| FEDERATED          | NO      | Federated MySQL storage engine                                 | NULL         | NULL | NULL       |
| PERFORMANCE_SCHEMA | YES     | Performance Schema                                             | NO           | NO   | NO         |
+--------------------+---------+----------------------------------------------------------------+--------------+------+------------+
9 rows in set (0.00 sec)

mysql>

不知道為什么找不到 SPHINX 引擎

只有重新安裝一遍看,于是參考網(wǎng)上的:

mysql> INSTALL PLUGIN sphinx SONAME 'ha_sphinx.so';
ERROR 1062 (23000): Duplicate entry 'sphinx' for key 'PRIMARY'
mysql>

mysql> UNINSTALL PLUGIN sphinx;
ERROR 1305 (42000): PLUGIN sphinx does not exist
mysql> 
mysql> 
mysql>  select * from mysql.plugin;
+--------+--------------+
| name   | dl           |
+--------+--------------+
| sphinx | ha_sphinx.so |
+--------+--------------+
1 row in set (0.00 sec)

mysql> UNINSTALL PLUGIN sphinx;
ERROR 1305 (42000): PLUGIN sphinx does not exist
mysql> 
mysql> 
mysql>  select * from mysql.plugin;
+--------+--------------+
| name   | dl           |
+--------+--------------+
| sphinx | ha_sphinx.so |
+--------+--------------+
1 row in set (0.00 sec)

mysql> 
mysql> delete from mysql.plugin where name='SPHINX';
Query OK, 1 row affected (0.02 sec)

mysql> 
mysql> 
mysql> select * from mysql.plugin;
Empty set (0.00 sec)

mysql> install plugin SPHINX soname 'ha_sphinx.so';
Query OK, 0 rows affected (0.00 sec)

mysql> show engines;
+--------------------+---------+----------------------------------------------------------------+--------------+------+------------+
| Engine             | Support | Comment                                                        | Transactions | XA   | Savepoints |
+--------------------+---------+----------------------------------------------------------------+--------------+------+------------+
| InnoDB             | DEFAULT | Supports transactions, row-level locking, and foreign keys     | YES          | YES  | YES        |
| CSV                | YES     | CSV storage engine                                             | NO           | NO   | NO         |
| MEMORY             | YES     | Hash based, stored in memory, useful for temporary tables      | NO           | NO   | NO         |
| BLACKHOLE          | YES     | /dev/null storage engine (anything you write to it disappears) | NO           | NO   | NO         |
| MRG_MYISAM         | YES     | Collection of identical MyISAM tables                          | NO           | NO   | NO         |
| SPHINX             | YES     | Sphinx storage engine 2.1.7-release                            | NO           | NO   | NO         |
| MyISAM             | YES     | MyISAM storage engine                                          | NO           | NO   | NO         |
| ARCHIVE            | YES     | Archive storage engine                                         | NO           | NO   | NO         |
| FEDERATED          | NO      | Federated MySQL storage engine                                 | NULL         | NULL | NULL       |
| PERFORMANCE_SCHEMA | YES     | Performance Schema                                             | NO           | NO   | NO         |
+--------------------+---------+----------------------------------------------------------------+--------------+------+------------+
10 rows in set (0.00 sec)

mysql>

在開(kāi)始安裝之前,查檢一下mysql.plugin表,里邊是不是留有老版本的SPHINXSE沒(méi)有完全清理掉.

以上是“Mysql如何在線安裝其它引擎”這篇文章的所有內(nèi)容,感謝各位的閱讀!希望分享的內(nèi)容對(duì)大家有幫助,更多相關(guān)知識(shí),歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道!


網(wǎng)站題目:Mysql如何在線安裝其它引擎
文章網(wǎng)址:http://weahome.cn/article/jposde.html

其他資訊

在線咨詢

微信咨詢

電話咨詢

028-86922220(工作日)

18980820575(7×24)

提交需求

返回頂部