CONTENTS


Lastmodified 2023-07-14 (金) 09:34:31


OBSOLETE

MySQL to MariaDB データ移行

https://www.unixmen.com/migrate-from-mysql-to-mariadb-in-freebsd/

https://dillix.com/blog/how-to-migrate-from-mysql-to-mariadb-on-freebsd/

開発用の MySQL の使用は無料です。 その製品 (MySQL) を配布するわけではないため、GPL 制限は適用されません。

MySQL を何らかの形式で配布する場合は、ライセンスが適用されます。 参照: MySQL 商用ライセンス

MariaDB はコミュニティによって開発された MySQL リレーショナル データベース管理システムのフォークであり、GNU GPL に基づいてコミュニティが無料ステータスを維持することがその原動力となっています。

主要なオープンソース ソフトウェア システムの分岐点として、オリジナルの開発者が主導し、買収した営利企業 Oracle による方向性への懸念がきっかけとなったことで注目に値します。

寄稿者は、Monty Program AB と著作権を共有する必要があります。

また、その目的は、MySQL との高い互換性を維持し、ライブラリのバイナリ同等性による「ドロップイン」置換機能と、MySQL API およびコマンドとの厳密な一致を保証することです。

これには、InnoDB の代替としての XtraDB ストレージ エンジンと、トランザクションおよび非トランザクション エンジンの両方となる新しいストレージ エンジン Aria が含まれており、将来のバージョンの MySQL にも含まれる可能性があります。

ノート:

1) この移行を開始する前にデータベースをバックアップしてください。

2) 次のコマンドを使用して MySQL デーモンを停止します。

# service mysql-server stop

3) Update ports collection

4) Check which version of MySQL you have:

# pkg_version -v | grep mysql
mysql-client-5.5.17                 =   up-to-date with port
mysql-server-5.5.17                 =   up-to-date with port
...

5) MySQL サーバーとクライアントのポートをアンインストールする必要があります

# cd /usr/ports/databases/mysql55-server/
# make deinstall clean
# cd /usr/ports/databases/mysql55-client/
# make deinstall clean

6) MariaDB サーバー、MariaDB クライアント、MariaDB スクリプトのインストール:

# cd /usr/ports/databases/mariadb-server
# make install clean

次のオプションを確認する必要があります。

[X] SSL        Activate SSL support (yassl)
[X] ARIADB     Aria storage engine
[X] ARCHIVE    Archive storage plugin
[X] BLACKHOLE  Blackhole storage engine
[X] SPHINX     SE client for Sphinx search daemon
[X] FEDX       FederatedX storage engine (Federated replacement)
[X] XTRADB     XtraDB (InnoDB replacement) engine
[X] PBXT       MVCC-based transactional engine

MariaDB クライアントは自動的にインストールされます。 次のオプションをチェックする必要があります。

[X] THREADSAFE  Build thread-safe client
[X] SSL         Activate SSL support (yassl)

MariaDB Scriptsをインストール

# cd /usr/ports/databases/mariadb-scripts/
# make install clean

7) すべてのポートが正常にインストールされているかどうかを確認します。

# pkg_version -v | grep maria
mariadb-client-5.2.9                =   up-to-date with port
mariadb-scripts-5.2.9               =   up-to-date with port
mariadb-server-5.2.9                =   up-to-date with port

8) MariaDB サーバーの起動:

# service mysql-server start

9) 以前に MySQL サーバーを持っていなかった場合は、MariaDB のインストール後に root ユーザーのパスワードを作成する必要があります。

# mysqladmin -u root password YOURSECUREPASSWORD

10) 次のようなエラーが発生した場合のヒント:

/libexec/ld-elf.so.1: Shared object "libmysqlclient.so.18" not found, required by "postfix"
#1286 - Unknown table engine 'InnoDB'
PDOException: SQLSTATE[42000]: Syntax error or access violation: 1286 Unknown table engine 'InnoDB': SELECT expire, value FROM {semaphore} WHERE name = :name; Array ( [:name] => variable_init ) in lock_may_be_available() (line 167 of /usr/home/usadentists/usadentists.com/htdocs/includes/lock.inc).
apache-2.2.17_1 cannot install: unknown MySQL version: 52.

ヒント 1: MySQL をサポートする Postfix または Dovecot を使用している場合は、それらを再インストールする必要があります。

ヒント 2: ポートのインストール時に MySQL バージョンが不明なメッセージが表示された場合は、/etc/make.conf を編集して次の行を追加する必要があります。

MYSQL52_LIBVER=16

ヒント 3: Drupal 7、Postfixadmin、または InnoDB テーブルまたは Sphinx 検索エンジンを必要とするその他のソフトウェアを使用している場合は、次のプラグインをアクティブにする必要があります。

# mysql -uroot -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 4656
Server version: 5.2.9-MariaDB-log Source distribution

This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> INSTALL PLUGIN sphinx SONAME 'ha_sphinx.so';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> INSTALL PLUGIN innodb SONAME 'ha_xtradb.so';
Query OK, 0 rows affected (0.11 sec)

MariaDB [(none)]> show engines;
EngineSupportCommentTransactionsXASavepoints
MyISAMDEFAULTDefault engine as of MySQL 3.23 with great performanceNONONO
InnoDBYESXtraDB engine based on InnoDB plugin. Supports transactions, row-level locking, and foreign keysYESYESYES
PBXTYESHigh performance, multi-versioning transactional engineYESYESNO
MEMORYYESHash based, stored in memory, useful for temporary tablesNONONO
CSVYESCSV storage engineNONONO
SPHINXYESSphinx storage engine 0.9.9NONONO
AriaYESCrash-safe tables with MyISAM heritageNONONO
MRG_MYISAMYESCollection of identical MyISAM tablesNONONO
8 rows in set (0.00 sec)

MariaDB [(none)]> exit;

Total access 218:本日 1:昨日 1

Counter: 218, today: 1, yesterday: 1

トップ   編集 凍結 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2023-07-14 (金) 09:34:31