5

OS: Debian10 App: Zabbix4.0 Installed app:Mariadb,Apache2,php

I got this error after I input this command in mysql.

create database zabbix character set utf8 collate utf8_bin;

and when I tried to restart zabbix-server,

zabbix-server.service: Can't open PID file /run/zabbix/zabbix_server..

Any idea regarding this error?

enter image description here

  • So please follow the guide https://www.zabbix.com/documentation/4.0/manu `create database zabbix`? Why? – KamilCuk Sep 25 '20 at 09:16
  • If i make create database zabbix, it will come out another error which is [incorrect default charset for zabbix database: "utf8mb4" instead "UTF8"]. That's why I made create database zabbix character set UTF8 collate UTF8_bin – Nurin Izzati Jafri Sep 25 '20 at 09:22
  • 1
    `"utf8mb4" instead "UTF8"` upgrade your mysql. Still create the database es explained in https://www.zabbix.com/documentation/4.0/manual/installation/install_from_packages/debian_ubuntu#creating_database (sorry, I copied wrong link in first comment) `zcat /usr/share/doc/zabbix-server-mysql/create.sql.gz | mysql -uzabbix -p zabbix` - you may edit the create.sql script not to create the database, or just change in it utf8mb4 to UTF8. A research what is `utf8mb4` and why was it introduced is advisable. – KamilCuk Sep 25 '20 at 09:31
  • FYI in the Debian 11 "bullseye" packages, the [PostgreSQL] SQL is now in `/usr/share/zabbix-server-pgsql/schema.sql.gz`, not `create.sql.gz`. – Robert Fleming Dec 08 '21 at 21:28

3 Answers3

1

The problem with Zabbix database can be solved with the following command:

sudo zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix_db

where zabbix_db is your Zabbix database name in which you named in MySQL configuration.

Then you need to restart your zabbix-server.

Ahmad Tanha
  • 121
  • 1
  • 8
0

I solved this problem by simply installing the newer version of zabbix which is 4.4 or 5.0. If this kind of problem occurs, I would suggest for you to install the newer version of Zabbix.

-1

This message means you don't have schema just run zcat /usr/share/doc/zabbix-server-mysql/create.sql.gz | mysql -uzabbix -p zabbix after that enter password wait around 10-30sec when import schema will be done for Ubuntu run:

systemctl restart zabbix-server zabbix-agent httpd php-fpm
systemctl enable zabbix-server zabbix-agent httpd php-fpm

Then go to http://server_ip_or_name/zabbix and complete setup.

buddemat
  • 4,552
  • 14
  • 29
  • 49
Reset
  • 1