mysql鏁呴殰妗堜緥
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了mysql鏁呴殰妗堜緥相关的知识,希望对你有一定的参考价值。
鏍囩锛?a href='http://www.mamicode.com/so/1/localhost' title='localhost'>localhost
mysql> create database dede;
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id: 47299
Current database: NONE
Query OK, 1 row affected (0.00 sec)
mysql> grant all privileges on dede.* to 鈥榙ede鈥楡鈥榣ocalhost鈥?identified by 鈥榙ede123鈥? ##鎺堟潈鏃舵墽琛屽け璐?br/>ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id: 47302
Current database: NONE
ERROR 1044 (42000): Access denied for user 鈥榬oot鈥楡鈥?鈥?to database 鈥榙ede鈥? ##鎷掔粷璁块棶鐨勭敤鎴?/p>
瑙e喅锛?br/>mysql> select Grant_priv from mysql.user where Host=鈥榣ocalhost鈥? ##N浠h〃娌℃湁鏉冮檺
+------------+
| Grant_priv |
+------------+
| N |
| N |
| N |
+------------+
3 rows in set (0.00 sec)
mysql> select Grant_priv from mysql.user where Host=鈥?27.0.0.1鈥?
+------------+
| Grant_priv |
+------------+
| Y |
+------------+
1 row in set (0.00 sec)
mysql> update mysql.user set Grant_priv=鈥榊鈥?where Host=鈥榣ocalhost鈥?
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id: 47312
Current database: NONE
Query OK, 3 rows affected (0.01 sec)
Rows matched: 3 Changed: 3 Warnings: 0
mysql> select Grant_priv from mysql.user where Host=鈥榣ocalhost鈥?
+------------+
| Grant_priv |
+------------+
| Y |
| Y |
| Y |
+------------+
3 rows in set (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql> grant all privileges on dede.* to 鈥榙ede鈥楡鈥榣ocalhost鈥?identified by 鈥榙ede123鈥?
ERROR 1044 (42000): Access denied for user 鈥榬oot鈥楡鈥?鈥?to database 鈥榙ede鈥?/p>
mysql> show variables like 鈥榬ead_only鈥?br/>-> ;
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id: 47323
Current database: NONE
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| read_only | OFF |
+---------------+-------+
1 row in set (0.00 sec)
mysql> show global variables like 鈥榤ax_allowed_packet鈥? ##鏌ョ湅max_allowed_packet鐨勫€硷紝榛樿鏄?MB
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id: 47339
Current database: NONE
+--------------------+---------+
| Variable_name | Value |
+--------------------+---------+
| max_allowed_packet | 1048576 |
+--------------------+---------+
1 row in set (0.00 sec)
mysql> set global max_allowed_packet=1024102416; ##涓存椂淇敼max_allowed_packet鍊间负16MB锛岄噸鍚け鏁?br/>ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id: 47341
Current database: NONE
Query OK, 0 rows affected (0.00 sec)
mysql> show global variables like 鈥榤ax_allowed_packet鈥? ##鏌ョ湅.,涓存椂宸茬敓鏁?br/>+--------------------+----------+
| Variable_name | Value |
+--------------------+----------+
| max_allowed_packet | 16777216 |
+--------------------+----------+
1 row in set (0.00 sec)
mysql> grant all privileges on dede.* to 鈥榙ede鈥楡鈥榣ocalhost鈥?identified by 鈥榙ede123鈥? ###grant鎺堟潈鐢ㄦ埛鎴愬姛
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id: 47347
Current database: NONE
Query OK, 0 rows affected (0.00 sec)
mysql> exit
Bye
###姘镐箙淇敼鍙傛暟
[[email protected] ~]# vim /etc/my.cnf
[mysqld]
max_allowed_packet = 16M
mysql 閲嶅惎鐢熸晥
以上是关于mysql鏁呴殰妗堜緥的主要内容,如果未能解决你的问题,请参考以下文章
HP M154nw褰╄壊鎵撳嵃鏈?鎵撳嵃WORD鏁呴殰鎺掓煡杩囩▼
13涓猅ensorflow瀹炶返妗堜緥锛屾暀浣犲叆闂ㄥ埌杩涢樁