问题
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
.
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 sqlflush | /Kiwi/manage.py dbshell'
i get:
CommandError: You appear not to have the 'mysql' program installed or on your path.
Exception ignored in: <_io.TextIOWrapper name='<stdout>' mode='w' encoding='UTF-8'>
BrokenPipeError: [Errno 32] Broken pipe
What should I do? I use instructions from: kiwi blog
回答1:
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).
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".
Without stopping the container try removing all data from all tables and restoring the json data.
来源:https://stackoverflow.com/questions/60207670/how-to-upload-a-database-on-kiwi-tcms-from-json-file