准备在NAS上折腾的,各种端口开放不方便,直接就用腾讯云服务器折腾吧。。。。。。
安装并运行数据库
安装:
1
| docker pull mysql:8.0.31
|
运行:
1 2 3 4 5 6 7 8 9 10 11 12
| docker run \ -d \ --name mysql \
-e MYSQL_ROOT_PASSWORD=jasmine888 \ -p 3306:3306 \
-v /usr/local/docker/mysql/data:/var/lib/mysql \ -v /usr/local/docker/mysql-files/log:/var/lib/mysql-files \ -v /usr/local/docker/mysql/log:/var/log/mysql \ mysql:8.0.31
|
1 2 3 4 5 6 7 8 9
| docker run \ -d \ --name mysql \ -e MYSQL_ROOT_PASSWORD=123456789 \ -p 3306:3306 \ -v /home/user/mysql/data:/var/lib/mysql \ -v /home/user/mysql/mysql-files/log:/var/lib/mysql-files \ -v /home/user/mysql/log:/var/log/mysql \ mysql:8.0.31
|
创建数据库:
1 2 3
| docker exec -it mysql /bin/bash mysql -uroot -p123456789 CREATE DATABASE `blossom` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
|
配置blossom
拉取镜像:
1
| docker pull jasminexzzz/blossom:latest
|
启动容器:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| docker run -d \ --name blossom-backend \ -p 9999:9999 \ -v /home/bl/:/home/bl/ \ jasminexzzz/blossom:latest \ --project.iaas.blos.domain="http://127.0.0.1:9999/pic/" \ --project.iaas.blos.default-path="/home/bl/img/" \ --spring.datasource.url="jdbc:mysql://192.168.31.99:3306/blossom?useUnicode=true&characterEncoding=utf-8&allowPublicKeyRetrieval=true&allowMultiQueries=true&useSSL=false&&serverTimezone=GMT%2B8" \ --spring.datasource.username=root \ --spring.datasource.password=jasmine888
|
1
| docker run -d --name blossom.231210 -p 9999:9999 -v /home/user/blossom/bl/:/home/bl/ jasminexzzz/blossom:latest --project.iaas.blos.domain="http://127.0.0.1:9999/pic/" --project.iaas.blos.default-path="/home/bl/img/" --spring.datasource.url="jdbc:mysql://IP地址:3306/blossom?useUnicode=true&characterEncoding=utf-8&allowPublicKeyRetrieval=true&allowMultiQueries=true&useSSL=false&&serverTimezone=GMT%2B8" --spring.datasource.username=root --spring.datasource.password=123466789
|
NAS同步数据库
参考如何把网站和重要数据定时自动备份到 Nas 群晖上?把MySQL备份到NAS上。