What is so creative?

MAMP環境でのphpMyAdmin文字化け回避法

MAMP(Mac+Apache+MySQL+PHP)環境でPHPからMySQLへ書き込んだ際に文字化けしてしまう場合がある。

 

■回避法

①MAMP/Library/supoprt-filesl配下に my-medium.cnf というファイルがあり db/mysql にコピーします。

②コピーしたファイル名を my.cnf とリネームします。

③そのファイルに書き内容を書き足します。

- - - - - - - - - - - - - - - - - - - - - - - - -

[mysqld]

default-character-set=utf8

skip-character-set-client-handshake

- - - - - - - - - - - - - - - - - - - - - - - - -

④MAMPを再起動します。

 

これでphpMyAdminで日本語が正常に表示されるはずです。

※原因が他にある場合あり

Comments

0 comments posted

Post new comment

Type the characters you see in this picture. (verify using audio)
Type the characters you see in the picture above; if you can't read them, submit the form and a new image will be generated. Not case sensitive.