1 apt update
安装mysql
2 apt install mysql-server -y
进入mysql
3 mysql
生成一个密码
4 openssl rand -base64 8
mysql> create user 'mysqlshitou'@'localhost' identified by 'MYWqmkO1Sh4';
Query OK, 0 rows affected (0.04 sec)
创建mysql用户 设置密码
grant all privileges on . to 'mysqlshitou'@'localhost';
Query OK, 0 rows affected (0.03 sec)
提示权限
mysql> flush privileges; 更新到后台,让修改的信息生效
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sys |
+--------------------+
4 rows in set (0.00 sec)安装zabbix
root@ubuntu:/home/ubuntu#
wget
https://repo.zabbix.com/zabbix/6.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_6.0-4+ubuntu22.04_all.deb
--2024-08-07 07:51:45-- https://repo.zabbix.com/zabbix/6.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_6.0-4+ubuntu22.04_all.deb
Resolving repo.zabbix.com (repo.zabbix.com)... 2604:a880:2:d0::2062:d001, 178.128.6.101
Connecting to repo.zabbix.com (repo.zabbix.com)|2604:a880:2:d0::2062:d001|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3676 (3.6K) [application/octet-stream]
Saving to: ‘zabbix-release_6.0-4+ubuntu22.04_all.deb’
zabbix-release_6.0-4+ubuntu22.04 100%[==========================================================>] 3.59K --.-KB/s in 0s
2024-08-07 07:51:46 (1.73 GB/s) - ‘zabbix-release_6.0-4+ubuntu22.04_all.deb’ saved [3676/3676]
root@ubuntu:/home/ubuntu# dpkg -i zabbix-release_6.0-4+ubuntu22.04_all.deb
Selecting previously unselected package zabbix-release.
(Reading database ... 75312 files and directories currently installed.)
Preparing to unpack zabbix-release_6.0-4+ubuntu22.04_all.deb ...
Unpacking zabbix-release (1:6.0-4+ubuntu22.04) ...
Setting up zabbix-release (1:6.0-4+ubuntu22.04) ...
root@ubuntu:/home/ubuntu# apt update
Hit:1 https://mirrors.aliyun.com/ubuntu jammy InRelease
Hit:2 https://mirrors.aliyun.com/ubuntu jammy-updates InRelease
Get:3 https://repo.zabbix.com/zabbix-agent2-plugins/1/ubuntu jammy InRelease [4,952 B]
Hit:4 https://mirrors.aliyun.com/ubuntu jammy-backports InRelease
Get:5 https://repo.zabbix.com/zabbix/6.0/ubuntu jammy InRelease [2,883 B]
Get:6 https://mirrors.aliyun.com/ubuntu jammy-security InRelease [129 kB]
Get:7 https://repo.zabbix.com/zabbix-agent2-plugins/1/ubuntu jammy/main Sources [1,002 B]
Get:8 https://repo.zabbix.com/zabbix-agent2-plugins/1/ubuntu jammy/main amd64 Packages [624 B]
Get:9 https://repo.zabbix.com/zabbix/6.0/ubuntu jammy/main Sources [25.1 kB]
Get:10 https://repo.zabbix.com/zabbix/6.0/ubuntu jammy/main amd64 Packages [82.4 kB]
Get:11 https://repo.zabbix.com/zabbix/6.0/ubuntu jammy/main all Packages [16.1 kB]
Fetched 262 kB in 2s (121 kB/s)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
4 packages can be upgraded. Run 'apt list --upgradable' to see the
安装组件
root@ubuntu:/home/ubuntu# apt install zabbix-server-mysql zabbix-frontend-php zabbix-apache-conf zabbix-sql-scripts zabbix-agentmysql
password
mysql> create database zabbix character set utf8mb4 collate utf8mb4_bin;
mysql> create user zabbix@localhost identified by 'MYWqmkO1Sh4';
mysql> grant all privileges on zabbix.* to zabbix@localhost;
mysql> set global log_bin_trust_function_creators = 1;
mysql> quit;zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | mysql --default-character-set=utf8mb4 -uzabbix -p zabbix 通过这个脚本导入到zabbix数据库里,会等待几分钟
为Zabbix server配置数据库密码
编辑配置文件 /etc/zabbix/zabbix_server.confvi /etc/zabbix/zabbix_server.conf
/DBPa查找
DBPassword=MYWqmkO1Sh4
重启+开机启动
root@ubuntu:/home/ubuntu# systemctl restart zabbix-server zabbix-agent apache2
root@ubuntu:/home/ubuntu# systemctl enable zabbix-server zabbix-agent apache2
下载中文语言包apt install language-pack-zh-hans
dpkg-reconfigure locales
找到zh_CN.utf8
sudo update-locale LANG=zh_CN.UTF-8systemctl restart apache2
ubuntu22.04安装zabbix6.0
本文采用 CC BY-NC-SA 4.0 许可协议,转载请注明出处。
评论交流
欢迎留下你的想法