特別な理由がある訳ではないが、Windowsの自宅サーバでのデーターベースがMySQLでなくMariaDBだったのでインストール。
//端末エディタ:管理者権限(sudo or su)
MariaDBのインストール
1 |
apt-get -y install mariadb-server |
1 2 3 4 5 |
vi /etc/mysql/mariadb.conf.d/50-server.cnf # 105,106行目:変更 character-set-server = utf8 collation-server = utf8mb4_general_ci systemctl restart mysql |
初期設定
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
mysql_secure_installation # root パスワードを設定 Set root password? [Y/n] y New password: Re-enter new password: Password updated successfully! Reloading privilege tables.. ... Success! # 匿名ユーザーは削除 Remove anonymous users? [Y/n] y ... Success! # テストデータベースは削除 Remove test database and access to it? [Y/n] y - Dropping test database... ... Success! - Removing privileges on test database... ... Success! Reloading the privilege tables will ensure that all changes made so far will take effect immediately. # 特権情報リロード Reload privilege tables now? [Y/n] y ... Success! Cleaning up... All done! If you've completed all of the above steps, your MariaDB installation should now be secure. Thanks for using MariaDB! # MariaDB に root ユーザーで接続して確認 mysql -u root -p Enter password: # 設定したパスワードで認証 MariaDB [(none)]> exit Bye 基本的な設定終了。 |
[1] 次にphpMyAdminのインストール(管理者権限)
1 |
apt-get -y install phpmyadmin php-mbstring php-gettext |
インストール中どこでphpMyAdminを使うか聞かれるので「*apache2」を指定する。
[2] phpMyAdmin に root ログインできるよう設定変更
1 2 3 4 5 6 |
mysql -u root -p mysql MariaDB [mysql]> update user set plugin='' where user='root'; MariaDB [mysql]> flush privileges; Query OK, 0 rows affected (0.00 sec) MariaDB [mysql]> exit Bye |
[3]Localでのみアクセス許可
1 2 3 |
vi /etc/phpmyadmin/apache.conf # 8行目あたりにアクセス許可するIPを追記 Require ip 127.0.0.1 192.168.0.0/24 |
1 |
systemctl restart apache2 |
http://localhost/phpmyadminでLogin画面を表示できれば設定終了。
次のステップは「WordPress」をインストールしてサーバーのホスト名で表示」させる。すでにXubuntu16.04上でXamppをインストールしてWordpressのドメインを「www.osshinet.com」に変更してあるデータをBackupしてあったので簡単に事が運ぶと思ったけど。。。失敗の繰り返しで気が滅入ることもあったが何とか完成させることができた。
*Backup list: Wodpress全データ(Login用のパスワード)、MysQLのwordpressデータ(sql)