LoginSignup
1
0

More than 3 years have passed since last update.

macでmysqlクライアント使うときの注意点

Last updated at Posted at 2020-03-31

Catalina で mysql クライント使おうと思った時に設定したことのメモ

インストール

$ brew install mysql

my.cnf

homebrewでインストールした場合、my.cnf の場所は /usr/local/etc/my.cnf っぽい。

/etc/my.cnf とかにはないので注意。

/usr/local/etc/my.cnf
# Default Homebrew MySQL server config
[mysqld]
# Only allow connections from localhost
bind-address = 127.0.0.1
mysqlx-bind-address = 127.0.0.1

初期値はこんな感じ。

日本語使うなら下記の記述を追記

[mysql]
default-character-set = utf8

リモートサーバー接続するときの注意点

ポートフォワーディングでリモートサーバーのDBに接続しようとした際に、下記のようなErrorが表示された。

$ mysql -h 127.0.0.1
ERROR 2026 (HY000): SSL connection error: error:141A318A:SSL routines:tls_process_ske_dhe:dh key too small

SSL接続を強制されてなければ、--ssl-mode=DISABLED をつければOK。

$ mysql --ssl-mode=DISABLED -h 127.0.0.1

接続先のサーバー古すぎるからかも。

1
0
0

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
1
0