1、在mysql创建好数据库和相关用户,并授权
CREATE DATABASE metabase; CREATE USER metabase@'172.17.0.0/24' IDENTIFIED BY '123456'; GRANT USAGE ON metabase.* TO 'metabase@'172.17.0.0/24'; FLUSH PRIVILEGES;
看一下metabase容器的启动命令,history|grep metabase
docker run -d -p 3000:3000 -v /data/metabase-data:/metabase-data -e "MB_DB_FILE=/metabase-data/metabase.db" --name metabase metabase/metabase
我们需要备份的h2文件在容器里的完整路径为/metabase.db/metabase.db.mv.db,备份一下到物理机。
docker cp metabase:/metabase.db/metabase.db.mv.db /data/backup/metabase.db.mv.db标签:metabase,h2,db,mysql,docker,data From: https://www.cnblogs.com/sherlock-merlin/p/17553703.html