データーベースにユーザ「masago」を追加し、
c:\xampp\mysql\bin>mysql -u masago -p
Enter password: ******
でログインに成功した。
しかし、
mysql>show databases;
を実施すると、
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id: 27
Current database: *** NONE ***
ERROR 1184 (08S01): Aborted connection 27 to db: 'unconnected' user: 'test' host:
と言うエラーが出た。
そこで下記のような処理をしたら、無事うまく行った。
c:\xampp\mysql\bin>mysql -u root -p
Enter password: *****
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 54
Server version: 5.6.21 MySQL Community Server (GPL)
Copyright (c) 2000, 2014, 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> SHOW GLOBAL VARIABLES LIKE "init%";
+---------------+------------------+
| Variable_name | Value |
+---------------+------------------+
| init_connect | 'SET NAMES utf8' |
| init_file | |
| init_slave | |
+---------------+------------------+
3 rows in set (0.00 sec)
mysql> SET GLOBAL init_connect='';
Query OK, 0 rows affected (0.02 sec)
mysql> \q
Bye
c:\xampp\mysql\bin>mysql -u masago -p
Enter password: ******
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 55
Server version: 5.6.21 MySQL Community Server (GPL)
Copyright (c) 2000, 2014, 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> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| cooking |
+--------------------+
2 rows in set (0.01 sec)
mysql>
c:\xampp\mysql\bin>mysql -u masago -p
Enter password: ******
でログインに成功した。
しかし、
mysql>show databases;
を実施すると、
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id: 27
Current database: *** NONE ***
ERROR 1184 (08S01): Aborted connection 27 to db: 'unconnected' user: 'test' host:
と言うエラーが出た。
そこで下記のような処理をしたら、無事うまく行った。
c:\xampp\mysql\bin>mysql -u root -p
Enter password: *****
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 54
Server version: 5.6.21 MySQL Community Server (GPL)
Copyright (c) 2000, 2014, 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> SHOW GLOBAL VARIABLES LIKE "init%";
+---------------+------------------+
| Variable_name | Value |
+---------------+------------------+
| init_connect | 'SET NAMES utf8' |
| init_file | |
| init_slave | |
+---------------+------------------+
3 rows in set (0.00 sec)
mysql> SET GLOBAL init_connect='';
Query OK, 0 rows affected (0.02 sec)
mysql> \q
Bye
c:\xampp\mysql\bin>mysql -u masago -p
Enter password: ******
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 55
Server version: 5.6.21 MySQL Community Server (GPL)
Copyright (c) 2000, 2014, 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> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| cooking |
+--------------------+
2 rows in set (0.01 sec)
mysql>