[root@mysql ~]#yum install mariadb-server -y[root@mysql ~]#vim /etc/my.cnf.d/mariadb-server.cnf
bind-address=10.0.2.18
[root@mysql ~]#systemctl restart mariadb[root@mysql ~]#mysql
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 8
Server version: 10.3.17-MariaDB MariaDB Server
Copyright (c) 2000, 2018, 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.001 sec)
MariaDB [(none)]> grant all privileges on zabbix.* to zabbix@'10.0.2.%' identified by 'xiurong';
Query OK, 0 rows affected (0.001 sec)
2、配置zabbix
[root@zabbix ~]#groupadd -g 1001 zabbix[root@zabbix ~]#useradd -u 1001 -g 1001 zabbix[root@zabbix ~]#id zabbix
uid=1001(zabbix) gid=1001(zabbix) groups=1001(zabbix)[root@zabbix ~]#yum install make gcc libxml2-devel net-snmp net-snmp-devel curl curl-devel php php-bcmath php-mbstring mariadb mariadb-devel -y[root@zabbix ~]#wget https://sourceforge.net/projects/zabbix/files/ZABBIX%20Latest%20Stable/4.4.7/zabbix-4.4.7.tar.gz[root@zabbix ~]#mv zabbix-4.4.7.tar.gz /usr/local/src/[root@zabbix ~]#cd /usr/local/src/[root@zabbix src]#tar xvf zabbix-4.4.7.tar.gz [root@zabbix src]#cd zabbix-4.4.7[root@zabbix zabbix-4.4.7]#yum install libevent-devel pcre-devel -y[root@zabbix zabbix-4.4.7]#./configure --prefix=/apps/zabbix_server --enable-server --enable-agent --with-mysql --with-net-snmp --with-libcurl --with-libxml2[root@zabbix zabbix-4.4.7]#make install[root@zabbix zabbix-4.4.7]#cd database/mysql/[root@zabbix mysql]#pwd
/usr/local/src/zabbix-4.4.7/database/mysql
[root@zabbix mysql]#mysql -uzabbix -pxiurong -h10.0.2.18 zabbix
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 9
Server version: 10.3.17-MariaDB MariaDB Server
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h'for help. Type '\c' to clear the current input statement.
MariaDB [zabbix]> use zabbix
Database changed
MariaDB [zabbix]> show tables;
Empty set(0.001 sec)
MariaDB [zabbix]>exit
Bye
[root@zabbix mysql]#mysql -uzabbix -pxiurong -h10.0.2.18 zabbix < schema.sql [root@zabbix mysql]#mysql -uzabbix -pxiurong -h10.0.2.18 zabbix < images.sql [root@zabbix mysql]#mysql -uzabbix -pxiurong -h10.0.2.18 zabbix < data.sql [root@zabbix mysql]#mysql -uzabbix -pxiurong -h10.0.2.18 zabbix
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 14
Server version: 10.3.17-MariaDB MariaDB Server
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h'for help. Type '\c' to clear the current input statement.
MariaDB [zabbix]> use zabbix
Database changed
MariaDB [zabbix]> show tables;
+----------------------------+
| Tables_in_zabbix |
+----------------------------+
| acknowledges || actions || alerts || application_discovery || application_prototype || application_template || applications || auditlog || auditlog_details || autoreg_host || conditions || config