8
7

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 5 years have passed since last update.

MySQLの文字化け

Posted at

Node.jsからMySQLを呼び出そうとしたときに文字化け発生したので対処したときのメモ。

#MySQL設定ファイル変更
$ sudo vi /etc/my.cnf
[mysqld]
・
・
・
character-set-server=utf8
default-storage-engine=InnoDB
default-character-set=utf8
skip-character-set-client-handshake
#MySQL再起動
$ sudo service mysqld restart

文字コードをutf-8に指定することで文字化けが解消されました。

/etc/my.cnfのどの部分が有効だったのかイマイチ分かってないですが,とりあえずMySQL側の設定で直りました。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?