So I have a MySQL database for my Django project which I think is located in the default directly (wherever that should be). When I want to move my Django project to digital ocean, how do I move that database? The my.cnf file is located inside the same directory as the settings.py file for the Django project. I am using macOS.
In short: How do I copy my database file to my Django project directory and reconfigure its path to that?
Compare the MySQL versions of both servers. Ensure the new version isn't less than the current version. Also check its not two major versions ahead of the current one.
Ensure MySQL is stopped.
Copy/move the entire datadir
to the new location. There should be no files in this new location that weren't in the original.
In the my.cnf
file set datadir to the new location.
Copy the my.cnf file to the location where mysql is expecting to read this on the new server. Look at top of mysqld --help --verbose
if you have doubts where this is.
There are many things to consider here,
host
in django to IP of that server(there are many things involved here...)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.