スポンサードリンク
Categories: ネット

XOOPSのモジュールをMySQL 5.5系にインストールする方法

<p><a title&equals;"ドメインキング" href&equals;"http&colon;&sol;&sol;px&period;a8&period;net&sol;svt&sol;ejp&quest;a8mat&equals;1TQIU9&plus;A5K67M&plus;CJY&plus;6HU7M" target&equals;"&lowbar;blank">ドメインキング<&sol;a> から、XOOPS Cube Legacy で作成していたサイトを <a title&equals;"さくらのVPS" href&equals;"http&colon;&sol;&sol;px&period;a8&period;net&sol;svt&sol;ejp&quest;a8mat&equals;1O7JBK&plus;6PQ15M&plus;D8Y&plus;BWVTE" target&equals;"&lowbar;blank">さくらのVPS<&sol;a> に移したのだが、モジュールインストール時に以下のようなエラーが出てインストールできなくなってしまった。<&sol;p>&NewLine;<blockquote><p>You have an error in your SQL syntax&semi; check the manual that corresponds to your MySQL server version for the right syntax to use near &&num;8216&semi;TYPE&equals;MyISAM&&num;8217&semi; at line XXX<&sol;p><&sol;blockquote>&NewLine;<p>どうやらMySQL 5&period;5系では &&num;8216&semi;TYPE&equals;MyISAM&&num;8217&semi; 指定が無効になっており、&&num;8217&semi;ENGINE&equals;MyISAM&&num;8217&semi; とSQL文を書いてやらないとダメな模様。このサーバーではremiレポジトリからPHP 5&period;3系・MySQL 5&period;5系がインストールされているため、既にインストールされていたモジュールは問題なかったものの、モジュールの新規インストールで問題が出たようだ。<&sol;p>&NewLine;<p>その後、いくつかのモジュールのSQLを確認したが、確認した限りのモジュール全てで &&num;8216&semi;TYPE&equals;MyISAM&&num;8217&semi; が使われていたため、全部置換するのも面倒だなーと思っていたら、XOOPS Cubeの公式フォーラムに投稿されていた以下のハックで解決。<&sol;p>&NewLine;<blockquote><p><a href&equals;"http&colon;&sol;&sol;xoopscube&period;jp&sol;forum&sol;6771" target&equals;"&lowbar;blank">MySQL 5&period;5&period;4 でトラブル<br &sol;>&NewLine;http&colon;&sol;&sol;xoopscube&period;jp&sol;forum&sol;6771<&sol;a><&sol;p><&sol;blockquote>&NewLine;<p>&nbsp&semi;<&sol;p>&NewLine;<pre lang&equals;"bash">class&sol;database&sol;sqlutility&period;php<&sol;pre>&NewLine;<p>の<&sol;p>&NewLine;<pre lang&equals;"php">function splitMySqlFile&lpar;&amp&semi;&dollar;ret&comma; &dollar;sql&rpar; &NewLine;&lbrace;<&sol;pre>&NewLine;<p>直下に、以下の行を挿入。<&sol;p>&NewLine;<pre lang&equals;"php">&dollar;sql &equals; str&lowbar;replace&lpar; 'TYPE&equals;MyISAM'&comma; 'ENGINE&equals;MyISAM'&comma; &dollar;sql &rpar;&semi;<&sol;pre>&NewLine;<p>これでモジュールのインストールができるようになった。<&sol;p>&NewLine;

スポンサードリンク
GUILZ.ORG

Share
Published by
GUILZ.ORG
スポンサードリンク