gpt4 book ai didi

mysql - 在 pythonanywhere 上备份 mysql 数据库

转载 作者:可可西里 更新时间:2023-11-01 07:57:02 33 4
gpt4 key购买 nike

我是 MySQL 的新手,知道如何使用 mysqldump 实用程序备份数据库。但是,我认为它没有安装在 pythonanywhere 上。对于如何备份我在 pythonanywhere 上创建的 mysql 数据库的任何建议,我将不胜感激。

谢谢。

最佳答案

[更新]

我们现在已经通过 bash 控制台 session 提供了 mysqldump 二进制文件,因此您可以继续使用它!

(对于任何好奇/受类似问题影响的人,历史答案如下)

PythonAnywhere admin here, we'll try and include mysqldump asap.

In the meantime, maybe some kind of serialization could be the answer?

If you're using Django for example, you could use its ORM to convert each record to some kind of JSON or XML serialised representation, and dump them to a text file...

Django has an admin command you can use for that:

python manage.py dumpdata my_app > my_app_dump.json

more info here: https://docs.djangoproject.com/en/dev/ref/django-admin/#dumpdata-appname-appname-appname-model

If you're not using django, maybe something like SQLAlchemy could help? there's a few pointers here: How to serialize SqlAlchemy result to JSON?

Maybe we'll just hurry up and get mysqldump in!

关于mysql - 在 pythonanywhere 上备份 mysql 数据库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10937775/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com