2012年6月4日月曜日

ERROR 2006 (HY000): MySQL server has gone away

$ mysql -u root -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2573
Server version: 5.5.14 MySQL Community Server (GPL) by Remi

Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> grant all privileges on wp_database.* to user@localhost identified by 'password' with grant option;
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id:    2574
Current database: *** NONE ***

Query OK, 0 rows affected (0.00 sec)

mysql> 
原因は文字コードの指定のようです。 /etc/my.cnfに以下の行を追加したところうまく動きました。
[mysqld]
character-set-server = utf8

[mysql]
default-character-set = utf8  <=== この行を追加

0 件のコメント:

コメントを投稿