Raspbian StretchにMariaDB

提供: オレッジベース
移動先: 案内検索

インストール

$ sudo apt install -y mariadb-server

初期設定

$ sudo vim /etc/mysql/mariadb.conf.d/50-server.cnf

以下のように修正

111行目
character-set-server = utf8

112行目
collation-server=utf8_general_ci

再起動

$ sudo systemctl restart mariadb

セキュリティ設定

$ sudo mysql_secure_installation
...
Enter current password for root (enter for none): → <PASSWORD> or Enter
...
Change the root password? [Y/n] → Y
...
Remove anonymous users? [Y/n] → Y
...
Disallow root login remotely? [Y/n] → Y
...
Remove test database and access to it? [Y/n] → Y
...
Reload privilege tables now? [Y/n] → Y
...

動作確認

$ sudo mysql -u root -p<PASSWORD>

アンインストール

$ sudo apt purge -y mariadb*