====== Mroonga9.12 インストール ====== Version 9.12 (MariaDB 10.4.12) --- //[[http://www.y2sunlight.com|y2sunlight]] 2020-11-02// [[mroonga:top|Mroonga に戻る]] 関連記事 * Mroonga10.7 インストール * [[mroonga:10.7:tutorial|Mroonga9.12 検索チュートリアル]] * [[mroonga:10.7:config|Mroonga9.12 全文検索の構成]] === 前提条件 === 本編では、XAMPP で稼働している MariaDB を MariaDB-with-Mroonga ( Mroongaの使えるMariaDB ) に置き換える事を目的としています。以下で説明するXAMPPのバージョンは次の通りです: * [[http://www.y2sunlight.com/ground/doku.php?id=xampp:7.3|XAMPP]] 7.3.15 * MariaDB 10.4.11 また、Mroonga のインストール先は、本編の[[http://www.y2sunlight.com/ground/doku.php?id=xampp:7.3|XAMPP]]と同じ以下のフォルダとします: * ''D:\usr\xampp7.3.15\mysql'' 尚、Mroonga Windows版のインストール方法については以下に掲載されています。 * https://mroonga.org/ja/docs/install/windows.html \\ ----- ===== パッケージの入手 ===== 本編で対象としている XAMPP7.3 に同封されている MariaDB 10.4.11 と同じマイナーバージョンを持つ MariaDB-with-Mroonga をダウンロードします。ここでは、MariaDB 10.4.12(with Mroonga9.12) の Windowsバイナリを以下のサイトから入手します。 * https://github.com/mroonga/mroonga/releases/tag/v9.12 [{{:mroonga:10.7:install01.png?nolink}}] ■ MariaDB 10.4.XX と同じマイナーバージョンを持つ以下のzipファイルを選択し、適当な場所にダウンロードします。 mariadb-10.4.12-with-mroonga-9.12-winx64.zip > ''注意'' > 他のバージョンのXAMPPをお使いの方も同様の方法でできると思います。XAMPPに同封されているMariaDBと同じバージョンを使用する理由は、稼働中のMariaDBのmy.iniを使用したいからです。my.iniを自分で設定する場合は、お好みのバージョンのMroongaをご使用下さい。また、Mroongaの多少のマーナ―バージョンの違いは許容範囲内だと思います。 \\ ===== インストール ===== === 稼働中のMariaDBの停止 === まず最初に、稼働中のMariaDBを停止してmysqlフォルダをリネームします。 - XAMPPのコントロールパネル(''{XAMPP-Folder}\xampp-control.exe'') または Windowsの [コンピュータの管理 > サービス] を使って mysqlサービスを停止します。 - 稼働中のmysqlフォルダ( ''mysql'' )を ''mysql.org'' リネームします。 === Mroongaの設置 === - 先にダウンロードしたZipファイル( mariadb-10.4.12-with-mroonga-9.12-winx64.zip ) を、例えば次のフォルダに解凍します。\\ ''D:\tmp\mariadb-10.4.12-with-mroonga-9.12-winx64'' - 解凍したファイルをXAMPPのmysqlフォルダに設置します。\\ 【元】''D:\tmp\mariadb-10.4.12-with-mroonga-9.12-winx64\mariadb-10.4.12-winx64''\\ 【先】''D:\usr\xampp7.3.15\mysql'' === my.iniの設定 === XAMPP で稼働中だった MariaDB の my.ini を新しいmysqlフォルダにコピーします。 【コピー元】''D:\usr\xampp7.3.15\mysql.org\bin\my.ini''\\ 【コピー先】''D:\usr\xampp7.3.15\mysql\bin\my.ini'' >''注意'' > Mroonga に限らず MariaDB でも現在は my.ini のサンプルファイル( my-small.iniやmy-medium.ini、my-large.iniなど ) はWindowsバイナリに同封されていません。「なぜ同封されなくなったのか?」の事情は、以下のページが参考になるかもしれません。\\ https://jira.mariadb.org/browse/MDEV-9882 \\ ===== サービスの開始 ===== XAMPPのコントロールパネル(''{XAMPP-Folder}\xampp-control.exe'') または Windowsの [コンピュータの管理 > サービス] を使って mysqlサービスを開始します。 >''注意'' > XAMPPの設定をそのまま利用しているので、XAMPPでインストールした時のサービスの設定が利用できます。手動でサービスを設定したい場合は、本編の[[xampp:7.2#サービスの手動登録|XAMPP 7.2のインストール サービスの手動登録]]を参照して下さい。 \\ ===== 動作確認 ===== コマンドプロンプトを起動して、mysqlフォルダ下のbin( ''D:\usr\xampp7.3.15\mysql\bin'' )に移動して下さい。mysqlコマンドをrootユーザで起動します。 D:\> mysql -u root version Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 15 Server version: 10.4.14-MariaDB Source distribution Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]> バージョンを確認します。 MariaDB [(none)]> select @@version; +-----------------+ | @@version | +-----------------+ | 10.4.14-MariaDB | +-----------------+ Mroonga がデータベースエンジンとして利用できるかを調べます。 MariaDB [(none)]> show engines; +--------------------+---------+-------------------------------------------------------------------------------------------------+--------------+------+------------+ | Engine | Support | Comment | Transactions | XA | Savepoints | +--------------------+---------+-------------------------------------------------------------------------------------------------+--------------+------+------------+ | CSV | YES | Stores tables as CSV files | NO | NO | NO | | MRG_MyISAM | YES | Collection of identical MyISAM tables | NO | NO | NO | | MEMORY | YES | Hash based, stored in memory, useful for temporary tables | NO | NO | NO | | Aria | YES | Crash-safe tables with MyISAM heritage. Used for internal temporary tables and privilege tables | NO | NO | NO | | MyISAM | YES | Non-transactional engine with good performance and small data footprint | NO | NO | NO | | SEQUENCE | YES | Generated tables filled with sequential values | YES | NO | YES | | Mroonga | YES | CJK-ready fulltext search, column store | NO | NO | NO | | PERFORMANCE_SCHEMA | YES | Performance Schema | NO | NO | NO | | InnoDB | DEFAULT | Supports transactions, row-level locking, foreign keys and encryption for tables | YES | YES | YES | +--------------------+---------+-------------------------------------------------------------------------------------------------+--------------+------+------------+ \\ ===== phpmyadminの利用 ===== XAMPPで設置した phpmyadmin も MariaDB with Mroonga で使えます。但し、phpmyadmin の初期設定を置き換えた新しいデータベースにしなければなりません。 === phpmyadminの起動 === ローカルホストのphpmyadminにアクセスします。 http://localhost/phpmyadmin/ [{{:mroonga:10.7:phpmyadmin01.png?nolink}}] ■ 起動後、以下のエラーが表示されます。 (!) mysqli::real_connect(): (HY000/1045): Access denied for user 'pma'@'localhost' (using password: NO) (!) 設定ファイルに定義されている管理ユーザ(controluser)での接続に失敗しました。 === phpmyadmin用のデータベースの作成 === メニューの[インポート]を選択します。 [{{:mroonga:10.7:phpmyadmin02.png?nolink}}] ■ 以下のファイルを選択し、画面下の[実行]ボタンを押します。 D:\usr\xampp7.3.15\phpMyAdmin\sql\create_tables.sql === phpmyadmin用のユーザの作成 === メニューの[SQL]を選択します。 [{{:mroonga:10.7:phpmyadmin03.png?nolink}}] ■ 以下のSQL文を入力して、[実行]ボタンを押します。 GRANT SELECT, INSERT, DELETE, UPDATE, ALTER ON `phpmyadmin`.* TO 'pma'@localhost; 以上で、MariaDB で Mroonga が使えるようになりました。 \\