0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

MySQL SQLの結果に記載されている日本語が"?"で表示される

Posted at

目的

  • SQLを実行した結果表示されるデータの日本語が?で表示されてしまう問題を解決する方法をメモ的に残す

方法

  1. 下記コマンドを実行してMySQLの設定ファイルのバックアップを取っておく。

    $ cp /etc/mysql/conf.d/mysql.cnf /etc/mysql/conf.d/mysql_org.cnf
    
  2. 下記コマンドを実行してMySQLの設定ファイルに追記できる状態にする。

    $ sudo cat << EOF > /etc/mysql/conf.d/mysql.cnf
    
  3. 下記の内容を一行一行入力してEnterを押下する。

    [mysql]
    [mysqld]
    character-set-server=utf8
    [client]
    default-character-set=utf8
    
  4. 最後の行を入力し終わったら「ctrl」 + 「d」を押下して保存する。

  5. MySQLを再起動する。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?