[root@server1~]# ls
zabbix-server-mysql-3.4.6-1.el7.x86_64.rpm
zabbix-web-3.4.6-1.el7.noarch.rpm
zabbix-web-mysql-3.4.6-1.el7.noarch.rpm
fping-3.10-1.el7.x86_64.rpm
iksemel-1.4-2.el7.centos.x86_64.rpm
php-bcmath-5.4.16-42.el7.x86_64.rpm
php-mbstring-5.4.16-42.el7.x86_64.rpm
zabbix-agent-3.4.2-1.el7.x86_64.rpm
[root@server1~]# yum install -y *.rpm
//安裝數據庫mariadb并進行初始化[root@server1 z~]# yum install -y mariadb-server
[root@server1~]# systemctl start mariadb
[root@server1~]# mysql_secure_installation
Set root password?[Y/n] y
New password:
Re-enter newpassword:
Remove anonymous users?[Y/n] Y
Disallow root login remotely?[Y/n] Y
Remove test database and access to it?[Y/n] Y
Reload privilege tables now?[Y/n] Y
[root@server1~]# systemctl restart mariadb
[root@server1~]# mysql -p
Enter password://直接回車
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 2
Server version:5.5.52-MariaDB MariaDB ServerCopyright (c)2000,2016, Oracle, MariaDB Corporation Ab and others.Type 'help;' or '\h'for help. Type '\c' to clear the current input statement.MariaDB [(none)]> create database zabbix character set utf8 collate utf8_bin;//創建數據庫
Query OK,1 row affected (0.00 sec)MariaDB [(none)]> grant all privileges on zabbix.* to zabbix@localhost identified by 'redhat';//進行授權
Query OK,0 rows affected (0.00 sec)MariaDB [(none)]> Bye
[root@server1~]# cd /usr/share/doc/zabbix-server-mysql-3.4.6/[root@server1 zabbix-server-mysql-3.4.6]# ls
AUTHORS ChangeLog COPYING create.sql.gz NEWS README
[root@server1 zabbix-server-mysql-3.4.6]# zcat create.sql.gz | mysql -u zabbix -p zabbix
Enter password://導入數據,輸入授權用戶zabbix的密碼[root@server1 zabbix-server-mysql-3.4.6]# mysql -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 9
Server version:5.5.52-MariaDB MariaDB ServerCopyright (c)2000,2016, Oracle, MariaDB Corporation Ab and others.Type 'help;' or '\h'for help. Type '\c' to clear the current input statement.MariaDB [(none)]> use zabbix;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -ADatabase changed
MariaDB [zabbix]> show tables;+----------------------------+| Tables_in_zabbix |+----------------------------+| acknowledges || actions || alerts || application_discovery |............略................| valuemaps || widget || widget_field |+----------------------------+140 rows in set (0.00 sec)MariaDB [zabbix]> Bye
[root@server1 zabbix-server-mysql-3.4.6]# cd /etc/zabbix/[root@server1 zabbix]# vim zabbix_server.conf
125 DBPassword=redhat
132 DBSocket=/var/lib/mysql/mysql.sock
[root@server1 zabbix]# ll /var/lib/mysql/mysql.sock
srwxrwxrwx 1 mysql mysql 0 Aug 1415:28/var/lib/mysql/mysql.sock
[root@server1 zabbix]# vim /etc/httpd/conf.d/zabbix.conf 19 php_value date.timezone Asia/Shanghai //修改時區[root@server1 zabbix]# systemctl start zabbix-server
[root@server1 zabbix]# systemctl start httpd
[root@server1 zabbix]# systemctl start zabbix-agent