max_allowed_packet 怎么修改?

Dision LI 2013-09-29 03:52:57

Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 10
Server version: 5.6.14 MySQL Community Server (GPL)

Copyright (c) 2000, 2013, 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 VARIABLES like '%max_allowed_packet%';
+--------------------------+------------+
| Variable_name | Value |
+--------------------------+------------+
| max_allowed_packet | 4194304 |
| slave_max_allowed_packet | 1073741824 |
+--------------------------+------------+
2 rows in set (0.00 sec)

mysql> set global max_allowed_packet = 2*1024*1024*10;
ERROR 1227 (42000): Access denied; you need (at least one of) the SUPER privileg
e(s) for this operation
mysql> set global max_allowed_packet = 16M;
ERROR 1227 (42000): Access denied; you need (at least one of) the SUPER privileg
e(s) for this operation
mysql>


使用的是mysql-5.6.14-win32
...全文
655 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
ACMAIN_CHM 2013-09-30
  • 打赏
  • 举报
回复
你的MYSQL服务的启动命令是什么? 看一下其中的参数文件名。如果没有,创建一个 my.ini
Dision LI 2013-09-30
  • 打赏
  • 举报
回复
引用 7 楼 ACMAIN_CHM 的回复:
你的MYSQL服务的启动命令是什么? 看一下其中的参数文件名。如果没有,创建一个 my.ini
谢谢,新建了一个my.ini文件就OK了
Dision LI 2013-09-29
  • 打赏
  • 举报
回复
引用 2 楼 vipper23 的回复:
修改my.ini,添加 max_allowed_packet = 16M
my.ini 是哪里的? 我这里根目录有 my-default.ini 文件 内容 # For advice on how to change settings please see # http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html # *** DO NOT EDIT THIS FILE. It's a template which will be copied to the # *** default location during install, and will be replaced if you # *** upgrade to a newer version of MySQL. [mysqld] max_allowed_packet=32M # Remove leading # and set to the amount of RAM for the most important data # cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%. # innodb_buffer_pool_size = 128M # Remove leading # to turn on a very important data integrity option: logging # changes to the binary log between backups. # log_bin # These are commonly set, remove the # and set as required. # basedir = ..... # datadir = ..... # port = ..... # server_id = ..... # Remove leading # to set options mainly useful for reporting servers. # The server defaults are faster for transactions and fast SELECTs. # Adjust sizes as needed, experiment to find the optimal values. # join_buffer_size = 128M # sort_buffer_size = 2M # read_rnd_buffer_size = 2M sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES 但是还是不行哦
Dision LI 2013-09-29
  • 打赏
  • 举报
回复
引用 1 楼 WWWWA 的回复:
没有权限 grant all privileges on *.* to root@'%' identified by "123";
刚用mysql,不懂怎么处理 上面那句提示 ERROR 1045 (28000): Access denied for user ''@'localhost' (using password: NO)
rucypli 2013-09-29
  • 打赏
  • 举报
回复
此用户没有修改参数的权限
ACMAIN_CHM 2013-09-29
  • 打赏
  • 举报
回复
引用 2 楼 vipper23 的回复:
修改my.ini,添加 max_allowed_packet = 16M
+1
vipper23 2013-09-29
  • 打赏
  • 举报
回复
修改my.ini,添加 max_allowed_packet = 16M
WWWWA 2013-09-29
  • 打赏
  • 举报
回复
没有权限 grant all privileges on *.* to root@'%' identified by "123";

56,681

社区成员

发帖
与我相关
我的任务
社区描述
MySQL相关内容讨论专区
社区管理员
  • MySQL
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧