スポンサーリンク


概要

  • DebianにMySQLを入れて、phpMyAdminで表示すると日本語が文字化けする。

対策

debian:~# emacs /etc/mysql/my.cnf
[client]
default-character-set = utf8

[mysqld]
skip-external-locking
character-set-server = utf8
collation-server = utf8_general_ci
init-connect = SET NAMES utf8
default-character-set = utf8
skip-character-set-client-handshake

[mysqldump]
default-character-set = utf8

[mysql]
default-character-set = utf8

MySQLの再起動

debian:~# /etc/init.d/mysql restart
Stopping MySQL database server: mysqld.
Starting MySQL database server: mysqld.
Checking for corrupt, not cleanly closed and upgrade needing tables..

確認方法

debian:~# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 87
Server version: 5.0.32-Debian_7etch11-log Debian etch distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> status;
--------------
mysql  Ver 14.12 Distrib 5.0.32, for pc-linux-gnu (i486) using readline 5.2

Connection id:          87
Current database:
Current user:           root@localhost
SSL:                    Not in use
Current pager:          stdout
Using outfile:          ''
Using delimiter:        ;
Server version:         5.0.32-Debian_7etch11-log Debian etch distribution
Protocol version:       10
Connection:             Localhost via UNIX socket
Server characterset:    utf8
Db     characterset:    utf8
Client characterset:    utf8
Conn.  characterset:    utf8
UNIX socket:            /var/run/mysqld/mysqld.sock
Uptime:                 19 min 18 sec

Threads: 1  Questions: 1187  Slow queries: 0  Opens: 143  Flush tables: 1  Open tables: 19  Queries per second avg: 1.025
--------------

参考


Debian MySQL 文字化け phpMyAdmin UTF-8 文字コード
Total:2614 / Today:3 / Yesterday:1


スポンサーリンク


トップ   差分 バックアップ リロード   一覧 検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2010-01-21 (木) 23:20:45