安装Mysql5.6
1.下载MySQL的repo源
#wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
2.安装mysql-community-release-el7-5.noarch.rpm包
#rpm -ivh mysql-community-release-el7-5.noarch.rpm
3.安装mysql
#yum install -y mysql-server
这里已经将MySQL安装好了,但是并不能登录,需要重置密码
4.重置密码前需要先登录
#mysql -u root
ERROR 2002 (HY000): Can‘t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock‘ (2)
#原因是/var/lib/mysql访问权限问题
5.修改权限
#chown -R root:root /var/lib/mysql
6.重启服务
#service mysqld restart
7.重置密码
#mysql -u root
mysql> use mysql;
mysql> update user set password=password(‘密码‘) where user=‘root‘;
mysql> flush privileges;
mysql> exit;
正式安装:
1.使用Mysql安装数据存储
#rpm -i https://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-2.el7.noarch.rpm
2.安装ZabBIX服务器、前端、代理
#yum install -y zabbix-server-mysql zabbix-web-mysql zabbix-agent
3.创建初始数据库
# mysql -uroot -p
root账户密码
mysql> create database zabbix character set utf8 collate utf8_bin;
mysql> grant all privileges on zabbix.* to [email protected] identified by ‘zabbix账号的密码‘;
mysql> quit;
4.导入初始模式和数据。将提示您输入新创建的密码。
#zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix
5.为ZabBIX服务器配置数据库
#vi /etc/zabbix/zabbix_server.conf
DBPassword=zabbix账号的密码
6.为ZabBIX前端配置PHP,去掉注释,并设置为自己的时区
#vi /etc/httpd/conf.d/zabbix.conf
php_value date.timezone Asia/Shanghai
7.启动ZabBIX服务器和代理进程并使其在系统启动时启动
# systemctl restart zabbix-server zabbix-agent httpd
# systemctl enable zabbix-server zabbix-agent httpd
原文地址:http://blog.51cto.com/keefe/2164187
时间: 2024-11-07 13:21:45