磯部 和広
k-iso****@rozet*****
2012年 6月 10日 (日) 12:25:48 JST
いつもお世話になっております。 本件、自己解決しました。 ■提案■ ひょっとすると、rpmのインストール時に発行しているSQL文を 下記にすると良いのかも知れません・・・ /usr/bin/mysql -u root -e "delete IGNORE from mysql.plugin where name = 'mroonga'; INSTALL PLUGIN mroonga SONAME 'ha_mroonga.so'; CREATE FUNCTION last_insert_grn_id RETURNS INTEGER soname 'ha_mroonga.so'; " ■補足■ アンインストール時のSQL文 /usr/bin/mysql -u root -e " DROP FUNCTION last_insert_grn_id; UNINSTALL PLUGIN mroonga; FLUSH TABLES; " にて、現在はuninstall/installが出来ていますが、 旧バージョンはuninstall時に管理テーブルにゴミを残す 場合があるようなので、ゴミがあっても良いように delete IGNORE from mysql.plugin where name = 'mroonga'; を実行すると良いと思います。 IGNORE オプションを付ける事で、エントリが存在しなくても エラーにならないので・・・ ■詳細■ ググレカスに変身した所、下記の託宣を得ました。 >MySQL の INSTALL PLUGIN に失敗する時の処方箋(mroonga-1.20編) http://d.hatena.ne.jp/yoshi-ken/20120204 ・・・つか、mroongaちゃん、過去にも同じ過ちを・・・ で、リンクの mroonga - mroonga 1.20リリース http://mroonga.github.com/ja/blog/2012/01/29/release.html に従い、下記を実施したのですが、やはり同様の結果でした。 sudo yum remove -y mysql-mroonga sudo yum install -y mysql-mroonga >今のmroongaのRPMの作りがあまりよくなくて >"yum remove"を忘れるとプラグイン管理テーブル(?)が >壊れてしまいます。 これ、早く完治するといいですね・・・ 手動で下記を実施した所、壊れた管理テーブルは治りました。 delete IGNORE from mysql.plugin where name = 'mroonga'; 管理テーブルが壊れていなければ、単純に remove/installで行けました。 今、試しにmysql.pluginテーブルからmroongaのエントリーだけをdeleteして プラグインのインストール用SQL文を実行して見ましたが、問題無く「delete は」実行出来ました。 下記は、mysql-mroongaのremove/install のエビデンスです。 ※これだけでは、管理テーブルが壊れているので失敗します。 [k-isobe @ PMJ-DB1 ~]$ sudo yum remove -y mysql-mroonga Loaded plugins: fastestmirror Setting up Remove Process Resolving Dependencies --> Running transaction check ---> Package mysql-mroonga.x86_64 0:2.03-1 set to be erased --> Finished Dependency Resolution Dependencies Resolved ======================================================================================================================================= Package Arch Version Repository Size ======================================================================================================================================= Removing: mysql-mroonga x86_64 2.03-1 installed 1.3 M Transaction Summary ======================================================================================================================================= Remove 1 Package(s) Reinstall 0 Package(s) Downgrade 0 Package(s) Downloading Packages: Running rpm_check_debug Running Transaction Test Finished Transaction Test Transaction Test Succeeded Running Transaction /usr/bin/mysql -u root -e " DROP FUNCTION last_insert_grn_id; UNINSTALL PLUGIN mroonga; FLUSH TABLES; " ERROR 1305 (42000) at line 1: FUNCTION (UDF) last_insert_grn_id does not exist run the following command to unregister mroonga: /usr/bin/mysql -u root -e " DROP FUNCTION last_insert_grn_id; UNINSTALL PLUGIN mroonga; FLUSH TABLES; " Erasing : mysql-mroonga 1/1 Removed: mysql-mroonga.x86_64 0:2.03-1 Complete! [k-isobe @ PMJ-DB1 ~]$ sudo yum install -y mysql-mroonga Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: www.ftp.ne.jp * extras: www.ftp.ne.jp * updates: www.ftp.ne.jp Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package mysql-mroonga.x86_64 0:2.03-1 set to be updated --> Finished Dependency Resolution Dependencies Resolved ======================================================================================================================================= Package Arch Version Repository Size ======================================================================================================================================= Installing: mysql-mroonga x86_64 2.03-1 groonga 526 k Transaction Summary ======================================================================================================================================= Install 1 Package(s) Upgrade 0 Package(s) Total download size: 526 k Downloading Packages: mysql-mroonga-2.03-1.x86_64.rpm | 526 kB 00:00 Running rpm_check_debug Running Transaction Test Finished Transaction Test Transaction Test Succeeded Running Transaction Installing : mysql-mroonga 1/1 /usr/bin/mysql -u root -e " INSTALL PLUGIN mroonga SONAME 'ha_mroonga.so'; CREATE FUNCTION last_insert_grn_id RETURNS INTEGER soname 'ha_mroonga.so'; " ERROR 1062 (23000) at line 1: Duplicate entry 'mroonga' for key 'PRIMARY' run the following command to register mroonga: /usr/bin/mysql -u root -e " INSTALL PLUGIN mroonga SONAME 'ha_mroonga.so'; CREATE FUNCTION last_insert_grn_id RETURNS INTEGER soname 'ha_mroonga.so'; " Installed: mysql-mroonga.x86_64 0:2.03-1 Complete! [k-isobe @ PMJ-DB1 ~]$ 下記は、上記の提案のイン ストール用SQL文 の実行結果のエビデンスです。 [k-isobe @ PMJ-DB1 ~]$ /usr/bin/mysql -u root -e "delete IGNORE from mysql.plugin where name = 'mroonga'; INSTALL PLUGIN mroonga SONAME 'ha_mroonga.so'; CREATE FUNCTION last_insert_grn_id RETURNS INTEGER soname 'ha_mroonga.so'; " [k-isobe @ PMJ-DB1 ~]$ /usr/bin/mysql -u root -e "delete IGNORE from mysql.plugin where name = 'mroonga';" [k-isobe @ PMJ-DB1 ~]$ /usr/bin/mysql -u root -e "delete IGNORE from mysql.plugin where name = 'mroonga'; INSTALL PLUGIN mroonga SONAME 'ha_mroonga.so'; CREATE FUNCTION last_insert_grn_id RETURNS INTEGER soname 'ha_mroonga.so'; " ERROR 1125 (HY000) at line 1: Function 'mroonga' already exists [k-isobe @ PMJ-DB1 ~]$ echo "show engines" | mysql -u root | grep mroonga mroonga YES CJK-ready fulltext search, column store NO NO NO [k-isobe @ PMJ-DB1 ~]$ 下記は、管理テーブルが壊れていない状況下での mysql-mroongaのremove/install のエビデンスです。 [k-isobe @ PMJ-DB1 ~]$ sudo yum remove -y mysql-mroonga Loaded plugins: fastestmirror Setting up Remove Process Resolving Dependencies --> Running transaction check ---> Package mysql-mroonga.x86_64 0:2.03-1 set to be erased --> Finished Dependency Resolution Dependencies Resolved ======================================================================================================================================= Package Arch Version Repository Size ======================================================================================================================================= Removing: mysql-mroonga x86_64 2.03-1 installed 1.3 M Transaction Summary ======================================================================================================================================= Remove 1 Package(s) Reinstall 0 Package(s) Downgrade 0 Package(s) Downloading Packages: Running rpm_check_debug Running Transaction Test Finished Transaction Test Transaction Test Succeeded Running Transaction /usr/bin/mysql -u root -e " DROP FUNCTION last_insert_grn_id; UNINSTALL PLUGIN mroonga; FLUSH TABLES; " Erasing : mysql-mroonga 1/1 Removed: mysql-mroonga.x86_64 0:2.03-1 Complete! [k-isobe @ PMJ-DB1 ~]$ echo "show engines" | mysql -u root Engine Support Comment Transactions XA Savepoints MyISAM DEFAULT MyISAM storage engine NO NO NO CSV YES CSV storage engine NO NO NO MRG_MYISAM YES Collection of identical MyISAM tables NO NO NO BLACKHOLE YES /dev/null storage engine (anything you write to it disappears) NO NO NO MEMORY YES Hash based, stored in memory, useful for temporary tables NO NO NO PERFORMANCE_SCHEMA YES Performance Schema NO NO NO ARCHIVE YES Archive storage engine NO NO NO InnoDB YES Supports transactions, row-level locking, and foreign keys YES YES YES FEDERATED NO Federated MySQL storage engine NULL NULL NULL [k-isobe @ PMJ-DB1 ~]$ sudo yum install -y mysql-mroonga Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: www.ftp.ne.jp * extras: www.ftp.ne.jp * updates: www.ftp.ne.jp Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package mysql-mroonga.x86_64 0:2.03-1 set to be updated --> Finished Dependency Resolution Dependencies Resolved ======================================================================================================================================= Package Arch Version Repository Size ======================================================================================================================================= Installing: mysql-mroonga x86_64 2.03-1 groonga 526 k Transaction Summary ======================================================================================================================================= Install 1 Package(s) Upgrade 0 Package(s) Total download size: 526 k Downloading Packages: mysql-mroonga-2.03-1.x86_64.rpm | 526 kB 00:00 Running rpm_check_debug Running Transaction Test Finished Transaction Test Transaction Test Succeeded Running Transaction Installing : mysql-mroonga 1/1 /usr/bin/mysql -u root -e " INSTALL PLUGIN mroonga SONAME 'ha_mroonga.so'; CREATE FUNCTION last_insert_grn_id RETURNS INTEGER soname 'ha_mroonga.so'; " Installed: mysql-mroonga.x86_64 0:2.03-1 Complete! [k-isobe @ PMJ-DB1 ~]$ echo "show engines" | mysql -u root | grep mroonga mroonga YES CJK-ready fulltext search, column store NO NO NO [k-isobe @ PMJ-DB1 ~]$