「Raspbian StretchにMariaDB」の版間の差分

提供: オレッジベース
移動先: 案内検索
(ページの作成:「=== インストール === <syntaxhighlight lang="bash"> $ sudo apt-get install -y mariadb-server </syntaxhighlight> === 初期設定 === <syntaxhighlight lang="bash"> $...」)
 
46行目: 46行目:
 
$ sudo mysql -u root -p<PASSWORD>
 
$ sudo mysql -u root -p<PASSWORD>
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
 +
 +
[[Category:MariaDB]]
 +
[[Category:Raspbian]]
 +
[[Category:Stretch]]

2017年12月17日 (日) 02:30時点における版

インストール

$ sudo apt-get 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>