CentOS默认情况下提供了一个很老的版本的MysqL 5.1。我们需要MysqL5.6以上版本,需要删除旧版本。
配置MysqL源
安装MysqL
- [root@hyg~]#yuminstallMysqL-server
查看MysqL版本
- [root@hyg~]#yumlistinstalled|grepMysqL
- MysqL-community-client.x86_64
- 5.6.32-2.el6@MysqL56-community
- MysqL-community-common.x86_64
- 5.6.32-2.el6@MysqL56-community
- MysqL-community-libs.x86_64
- 5.6.32-2.el6@MysqL56-community
- MysqL-community-release.noarch
- MysqL-community-server.x86_64
- 5.6.32-2.el6@MysqL56-community
修改MysqL配置文件. /etc/my.cnf,在[MysqLd]中添加innodb_file_per_table=1
启动
- [root@hyg~]#serviceMysqLdstart
初始化安全数据库
- [root@hyg~]#MysqL_secure_installation
- [root@hyg~]#MysqL-uroot-p123456
数据库字符集
- MysqL>CREATEDATABASEzabbixCHARACTERSETutf8COLLATEutf8_bin;
- QueryOK,1rowaffected(0.00sec)
- MysqL>GRANTALLPRIVILEGESONzabbix.*TOzabbix@localhostIDENTIFIEDBY'gz';
- QueryOK,0rowsaffected(0.00sec)
检查授权是否成功
Zabbix 3需要PHP5.4或更高版本。所以配置一个PHP源。
- [root@hyg~]#rpm-ivhhttp://repo.webtatic.com/yum/el6/latest.rpm
安装所需的包
- [root@hyg~]#vim/etc/PHP.ini
- post_max_size=16M
- max_execution_time=300
- max_input_time=300
- date.timezone=Asia/Shanghai
- always_populate_raw_post_data=-1
启动web
- [root@hyg~]#servicehttpdstart
启用端口80上的iptables
- [root@hyg~]#iptables-IINPUT-ptcp--dport80-mstate--stateNEW,ESTABLISHED-jACCEPT
- [root@hyg~]#iptables-save>/etc/sysconfig/iptables