本文介绍了如何从json文件在Kiwi TCMS上上传数据库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通过docker-compose.yml在docker上拥有奇异鸟TCMS.而且我有数据库的文件json(旧版本的猕猴桃)要从旧服务器转储数据库,请使用:

I have kiwi TCMS on docker through docker-compose.yml. And i have file json with database (old version of kiwi) To dump database from old serwer i use:

docker exec -it kiwi_web/Kiwi/manage.py dumpdata --all --indent 2>database.json .

在新的猕猴桃TCMS中,我想使用旧数据库,但输入此命令后

In new kiwi TCMS i want use my old database, but after enter this command

docker exec -it kiwi_web/bin/bash -c'/Kiwi/manage.py/Kiwi/manage.py dbshel​​l'

我得到:

CommandError:您似乎没有安装"mysql"程序或在路径上.在< _io.TextIOWrapper name ='< stdout>'中忽略了异常模式='w'编码='UTF-8'>BrokenPipeError:[Errno 32]管道损坏

我该怎么办?我使用以下指令进行操作:奇异鸟博客

What should I do?I use instructions from: kiwi blog

推荐答案

mysql (这是构建过程的副作用,在此二进制文件包含在其中之前图片).

mysql is indeed missing inside the web docker image (this is a side effect from the build process, before this binary was included in the image).

您可以通过 docker exec -u 0 -it kiwi_web/bin/bash ->解决,这将为您提供容器内部的root特权.一旦进入"yum install mariadb"或"yum install mysql".

You can work around by docker exec -u 0 -it kiwi_web /bin/bash -> this will give you root privileges inside the container. Once you are inside "yum install mariadb" or "yum install mysql".

在不停止容器的情况下,尝试从所有表中删除所有数据并恢复json数据.

Without stopping the container try removing all data from all tables and restoring the json data.

这篇关于如何从json文件在Kiwi TCMS上上传数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-27 10:26