株式会社ヴァンデミックシステム

Blog

<スポンサーリンク>

なんか文字化けしている・・・そんなときは

UTF8設定を入れてあげる

# vim /etc/mysql/mysql.conf.d/mysqld.cnf
[mysqld]
pid-file        = /var/run/mysqld/mysqld.pid
socket          = /var/run/mysqld/mysqld.sock
datadir         = /var/lib/mysql
#log-error      = /var/log/mysql/error.log
# By default we only accept connections from localhost
#bind-address   = 127.0.0.1
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0

character-set-server=utf8
collation-server=utf8_general_ci

[client]
default-character-set=utf8

DockerはDebian系ベースなのかな?
vimなどパッケージをインストールするとき

apt-get -y update
apt-get -y install vim

<スポンサーリンク>

1 Comment

1 Record

  1. on 2019年8月29日 at 6:15 PM
    たに wrote:

    MySQLの文字コードは、root権限はいって、以下のコマンドで確認します。
    show variables like “character%”;

    あるあるなのは、上記コマンドの出力結果のうち、「laten1」というものが設定されている(ASCIIのことですが)と、文字化けするので、utf8の設定を入れてあげます。

    返信

コメントを残す

Allowed tags:  you may use these HTML tags and attributes: <a href="">, <strong>, <em>, <h1>, <h2>, <h3>
Please note:  all comments go through moderation.

*

日本語が含まれない投稿は無視されますのでご注意ください。(スパム対策)