docker run -p 3306:3306 \ --name mysql-server -t \ -v /etc/localtime:/etc/localtime \ -v /mnt/mysql/conf:/etc/mysql/conf.d \ -v /mnt/mysql/logs:/logs \ -v /mnt/mysql/data:/var/lib/mysql \ -e MYSQL_DATABASE="zabbix" \ -e MYSQL_USER="zabbix" \ -e MYSQL_PASSWORD="zabbix_pwd" \ -e MYSQL_ROOT_PASSWORD="root_pwd" \ -e TZ=Asia/Shanghai \ --restart unless-stopped \ -d mysql:8.0 \ --character-set-server=utf8 --collation-server=utf8_bin \ --default-authentication-plugin=mysql_native_password docker run --name zabbix-server-mysql -t \ -e DB_SERVER_HOST="mysql-server" \ -e MYSQL_DATABASE="zabbix" \ -e MYSQL_USER="zabbix" \ -e MYSQL_PASSWORD="zabbix_pwd" \ -e MYSQL_ROOT_PASSWORD="root_pwd" \ -e PHP_TZ="Asia/Shanghai" \ -e TZ=Asia/Shanghai \ -v /etc/localtime:/etc/localtime \ -p 10051:10051 \ --restart unless-stopped \ -d zabbix/zabbix-server-mysql:alpine-6.2-latest docker run --name zabbix-web-nginx-mysql -t \ -e ZBX_SERVER_HOST="zabbix-server-mysql" \ -e DB_SERVER_HOST="mysql-server" \ -e MYSQL_DATABASE="zabbix" \ -e MYSQL_USER="zabbix" \ -e MYSQL_PASSWORD="zabbix_pwd" \ -e MYSQL_ROOT_PASSWORD="root_pwd" \ -e PHP_TZ="Asia/Shanghai" \ -e TZ=Asia/Shanghai \ -v /etc/localtime:/etc/localtime \ -p 90:8080 \ --restart unless-stopped \ -d zabbix/zabbix-web-nginx-mysql:alpine-6.2-latest docker run --name zabbix-web-apache-mysql -t \ -e ZBX_SERVER_HOST="zabbix-server-mysql" \ -e DB_SERVER_HOST="mysql-server" \ -e MYSQL_DATABASE="zabbix" \ -e MYSQL_USER="zabbix" \ -e MYSQL_PASSWORD="zabbix_pwd" \ -e MYSQL_ROOT_PASSWORD="root_pwd" \ -e PHP_TZ="Asia/Shanghai" \ -e TZ=Asia/Shanghai \ -v /etc/localtime:/etc/localtime \ --restart unless-stopped \ -p 90:8080 \ -d zabbix/zabbix-web-apache-mysql:alpine-6.2-latest
打开zabbix的登录页面,账号密码分别是Admin:zabbix
docker run --name zabbix-agent -t \ -e ZBX_HOSTNAME="Zabbix server" \ -e ZBX_SERVER_HOST="zabbix-server-mysql" \ -e ZBX_SERVER_PORT="10051" \ -e TZ=Asia/Shanghai \ -v /etc/localtime:/etc/localtime \ --restart=always \ -p 10050:10050 \ --privileged \ -d zabbix/zabbix-agent:alpine-6.2-latest
标签:etc,部署,mysql,server,--,zabbix,MYSQL,docker From: https://www.cnblogs.com/libruce/p/17164109.html