Xampp インストール後のMySQLの「sjis」設定をしよう

(1)Cドライブの中の「xampp」フォルダにある「mysql」内の「bin」フォルダを開く

C → xampp → mysql → bin

(2)「my.ini」ファイルをエディタで開く

OSによっては「my.cnf」とかになっていることも


(3)145行目を次のように変更する

[mysqldump]
quick
max_allowed_packet = 16M

↓↓↓↓↓↓↓↓↓↓↓↓↓

[mysqldump]
quick
max_allowed_packet = 16M
default-character-set = sjis
skip-character-set-client-handshake


(4)また、べつの箇所を次のように変更する

[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates


↓↓↓↓↓↓↓↓↓↓↓↓↓

[mysql]
no-auto-rehash
default-character-set = sjis
skip-character-set-client-handshake

# Remove the next comment character if you are not familiar with SQL
#safe-updates



(4)さらに、つぎの箇所の最終行に2行追加する

[mysqld]

default-character-set = sjis
skip-character-set-client-handshake



MySQLの管理者[root]のパスワードを設定

設定は十分注意すること

sql> update mysql .user set password=password('1234') where user='root';

と入力し、

「Query OK, 1 row affected (0.00 sec)」

と表示されればOK! パスワード「1234」は任意




ブログ