[ZBX-15559] 安装 zabbix3.4.15 Configure DB connection 提示:Cannot connect to the database Error setting auto commit. Created: 2019 Jan 31  Updated: 2019 Feb 05  Resolved: 2019 Feb 05

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Installation (I)
Affects Version/s: 3.0.25
Fix Version/s: None

Type: Problem report Priority: Critical
Reporter: byheart Assignee: Zabbix Support Team
Resolution: Won't fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

操作系统centos7 DB percon8



 Description   

1、安装mysql,使用percona8 修改配置项添加
[client]
default-character-set=utf8
[mysql]
default-character-set=utf8
[mysqld]
character-set-server=utf8
collation-server=utf8_unicode_ci
init_connect='SET AUTOCOMMIT=1'

2、重启mysql
systemctl restart mysqld.service
3、创建zabbix数据库
create database zabbix
create user zabbix identified by 'xxxx';
grant all privileges on zabbix.* to zabbix@'localhost';
grant all privileges on zabbix.* to zabbix@'%';
flush privileges;

4、使用zabbix用户连接数据库检查autocommit
提示 autocommit on

4、启动zabbix
systemctl start httpd.service
5、访问zabbix进入配置安装界面
http://192.168.1.xx/zabbix
6、进行到Configure DB connection
 提示:Cannot connect to the database
Error setting auto commit.

 



 Comments   
Comment by Edgars Melveris [ 2019 Jan 31 ]

Please describe the issue in english

Comment by Alexey Pustovalov [ 2019 Jan 31 ]

Why did you specify init_connect='SET AUTOCOMMIT=1' ? It is not required for Zabbix and not recommended at all!

Comment by Arturs Lontons [ 2019 Feb 05 ]

Closing the issue due to lack of activity.

Generated at Wed Sep 10 01:22:01 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.