我是MySQL的新手,知道如何使用mysqldump实用程序备份数据库。但是,我认为它未安装在PythonAnywhere上。请给出任何建议,以便我可以备份在PythonAnywhere上创建的mysql数据库。
谢谢。
我是MySQL的新手,知道如何使用mysqldump实用程序备份数据库。但是,我认为它未安装在PythonAnywhere上。请给出任何建议,以便我可以备份在PythonAnywhere上创建的mysql数据库。
谢谢。
[更新]
我们现在已经通过bash控制台会话提供了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!