gpt4 book ai didi

mysql - SET GLOBAL max_allowed_pa​​cket 不起作用

转载 作者:IT老高 更新时间:2023-10-28 23:45:57 26 4
gpt4 key购买 nike

我发现了如何使用 SET GLOBAL 在 MySQL 中更改 max_allowed_pa​​cket 的默认值。但是,每次我使用这个命令时,默认值都保持不变!我使用了这些命令:

mysql --user=root --password=mypass
mysql> SET GLOBAL max_allowed_packet=32*1024*1024;
Query OK, 0 rows affected (0.00 secs)
mysql> SHOW VARIABLES max_allowed_packet;

然后结果是 max_allowed_pa​​cket = 1048576。我错过了什么?

最佳答案

嗯嗯.. 你打到了NOT-A-BUG它似乎。 :)

If you change a global system variable, the value is remembered and used for new connections until the server restarts. (To make a global system variable setting permanent, you should set it in an option file.) The change is visible to any client that accesses that global variable. However, the change affects the corresponding session variable only for clients that connect after the change. The global variable change does not affect the session variable for any client that is currently connected (not even that of the client that issues the SET GLOBAL statement).

请参阅 this也。阅读 Shane Bester 的解释。

您应该从 my.ini/my.cnf 文件更改并重新启动服务器以使 max_allowed_pa​​cket 设置生效。

关于mysql - SET GLOBAL max_allowed_pa​​cket 不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9922894/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com