Raspberry Piにインストールしたmariadbに別の端末から接続できない

はじめに

Raspberry Piにインストールしたmariadbに別の端末から接続しようとすると、以下のメッセージが表示され接続できない。

Can't connect to MySQL server on 'xxx.xxx.xxx.xxx'

前提

50-server.cnf を編集する

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

bind-address = 127.0.0.1コメントアウト

# bind-address = 127.0.0.1 

mariadbを再起動する

$ sudo systemctl restart mysql

確認する

別の端末から接続を行い確認します。