Home > Database > Mysql Tutorial > Fedora 11 BugZilla出现max_allowed_packet is readonly

Fedora 11 BugZilla出现max_allowed_packet is readonly

WBOY
Release: 2016-06-07 16:55:11
Original
985 people have browsed it

Fedora 11上安装BugZilla出现 max_allowed_packet is read-only问题的解决方法问题描述:当我运行已经安装完所有的perl模块以及M

Fedora 11上安装BugZilla出现 max_allowed_packet is read-only问题的解决方法
问题描述:

当我运行已经安装完所有的perl模块以及MySQL数据库后,./checksetup.pl时错误提示如下:
DBD::mysql::db do failed: SESSION variable 'max_allowed_packet' is read-only. Use SET GLOBAL to assign the value [for Statement "SET SESSION max_allowed_packet = 3276750"] at Bugzilla/DB/Mysql.pm line 113
 
Bugzilla::DB::Mysql::new('Bugzilla::DB::Mysql', 'bugs', 'bugs', 'localhost', 'bugs', 0, '') called at Bugzilla/DB.pm line 111

Bugzilla::DB::_connect('mysql', 'localhost', 'bugs', 0, '', 'bugs', 'bugs') called at Bugzilla/DB.pm line 96

Bugzilla::DB::connect_main() called at Bugzilla.pm line 317
Bugzilla::dbh('Bugzilla') called at ./checksetup.pl line 142

解决方法:

一、关闭selinux
因为自从Kernel 2.6开始,就有了SElinux(Security Enhance linux)安全加强的Linux. RHEL 4就有了SElinux的实现。Fedora11里当然也会

有SElinux,虽然安全,如果不满足其策略,它会阻止很多操作。所以干脆把它关掉。

编辑/etc/selinux/config文件

1.vi /etc/selinux/config
2.将SELINUX=enforcing改为SELINUX=disabled
3.:wq(保存退出)
4.reboot(重启)

二、注释对max_allow_packet的修改语句。
max_allow_packet本身的含义是客户端与服务器端交互数据最大值。默认是1G。
我在查阅Mysql menu时,有这样一句话:
On the client side, max_allowed_packet has a default of 1GB. ..... Beginning with MySQL 5.0.3, it also has a read-only

session scope
意思就是说max_allowed_packet has a default of 1GB.自从MySQL 5.0.3开始,,这个参数就被设置为只读了。而Fedora 11默认安装的是MySQL

5.1.3。而Bugzilla/DB/Mysql.pm的还想修改max_allowed_packet=300M,这个是不行。
[for Statement "SET SESSION max_allowed_packet = 3276750"] at Bugzilla/DB/Mysql.pm line 113

所以按照提示我找到了Bugzilla/DB/Mysql.pm line 113行:

$self->do("SET SESSION max_allowed_packet = $max_allowed_packet");

并把这样注释掉,也就是在这行前面加上#。形式如下:
#$self->do("SET SESSION max_allowed_packet = $max_allowed_packet");

三、运行./checksetup.pl
大功告成。

linux

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template