4

I am new to MySQL and know how to use mysqldump utility to backup a database. However, I think it is not installed on pythonanywhere. I would appreciate any suggestions on how I can back up mysql databases that I create on pythonanywhere.

Thank you.

1 Answer 1

7

[update]

We've now made the mysqldump binary available via bash console sessions, so you can just go ahead and use it!

(historical answer follows for anyone curious / affected by a similar problem)

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!

Sign up to request clarification or add additional context in comments.

3 Comments

Thank you. Would really appreciate if you can get mysqldump in soon. I am not using Django. This is not for a web app.
It works great. I am amazed by how promptly you installed it. Pythonanywhere team is awesome to work with.
Now if only we could get PostgreSQL installed...:)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.