Help us understand the problem. What is going on with this article?

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

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

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

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした