2020年7月23日木曜日

【62】番外編AtoM2.6のインストール

AtoM2.6のインストールについて、マニュアルhttps://www.accesstomemory.org/en/docs/2.6/admin-manual/installation/linux/ubuntu-bionic/#mysql
のみでは不十分な点があったので、備忘録としてブログを更新します。
マニュアル通りに進めると、最後のRun the web installerのDatabase登録のところで詰みます。データベースのパスワードを拒否するのです。これはAtoM2.6から、mysql8.xを使うようになり、DBユーザーの認証の初期設定が変ったために起こる問題です。

工夫がいるのは、mysqlの設定です。
Create Databaseの作業は、まずマニュアル通り、

sudo mysql -h localhost -u root -p -e "CREATE DATABASE atom CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci;"

を打ちます。
さらに、マニュアルにしたがい、

sudo mysql -h localhost -u root -p -e "CREATE USER 'atom'@'localhost' IDENTIFIED BY '12345';"
sudo mysql -h localhost -u root -p -e "GRANT ALL PRIVILEGES ON atom.* TO 'atom'@'localhost';"

を打ちます。'12345'は、任意のパスワードです。

それで、追加するのは次の命令文。

sudo mysql -h localhost -u root -p -e "ALTER USER ‘atom’@‘localhost' IDENTIFIED WITH mysql_native_password BY '12345';"

'12345'は、上記のパスワードなので、必ず一致させます。

この命令文が何をやったかは次の記事が参考になります。
https://motomotosukiyaki.com/mysql-from-php-server-requested-authentication-method-unknown-to-the-client/

完全に理解していないので、推測で説明します。
まずMysqlに入ります。

$ sudo mysql -u root -p

データベースのユーザーを示すテーブルに切り替える?

mysql> use mysql 

ユーザー一覧を表示します。

mysql> select user, host, plugin from user;

ここで、atomの認証(plugin)がcaching_sha2_passwordとなっているのが問題です。
認証を上で設定したパスワードの12345に変更してやります。

mysql> alter user 'atom'@'localhost' identified with mysql_native_password by '12345';

atomというユーザーがパスワード12345でMysqlに入れるようになりました。
mysql> select user, host, plugin from user;
で再確認。

以上の設定で、Run the web installerのDatabase登録を無事終えることができました。

さて、次回の道場は7/31(金)です。
よろしくお願いします。





最近の投稿

【108】Archives in the Digital Age: The use of AI and machine learning in the Swedish archival sectorを読む

 Gijs Aangenendt氏の修士論文、Archives in the Digital Age: The use of AI and machine learning in the Swedish archival sectorを半分読みました。 前半は、AIを扱ったアーカ...

人気の投稿