LoginSignup
6
7

More than 5 years have passed since last update.

MySQLの外部接続の設定

Last updated at Posted at 2016-09-15

MySQLの外部接続の設定

外部の端末からMySQLに接続可能にするための設定。
忘れそうなのでメモ。
接続用のユーザは追加済み。

環境

  • Ubuntu Server 16.04 LTS
  • MySQL-server 5.7

設定

いくつかのサイトで、設定ファイルのbind-addressに接続端末のIPアドレスを追記するかコメントアウトするとあったが、設定ファイルmy.cnfにはbind-addressの記述はないし、my.iniは見当たらないし。
で、mysqld.cnfにそれらしき記述を発見。

mysqld.cnfを編集する

$ sudo vi /etc/mysql/mysql.conf.d/mysqld.cnf

43行目のbind-addressをコメントアウトする。

# bind-address = 127.0.0.1

MySQLを再起動

$ sudo service mysql restart

これで外部接続できたので、たぶんこれでいいのかな・・・?

以上

6
7
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
7