I’d recommend doing something like the following to import a MySQL database:
- Follow this guide to hosting a MySQL database on Render.
- Use
mysqldump
to get a backup file for the existing database. - Use magic wormhole to transfer the backup file to your mysql Render service.
- Import the backup file that you just transferred with the
mysql
CLI.
For steps 3 and 4 you’ll need to use the built-in Shell in the Render dashboard. I’m happy to elaborate on any of these steps
@david thanks for the steps
I can’t do Step2:
bash-4.4# mysqldump --all-databases
mysqldump: Got error: 1045: Access denied for user 'root'@'localhost' (using password: NO) when trying to connect
Hi there,
The error you shared looks like your existing database requires some specific credentials or password to connect to MySQL. Maybe these connection details are listed in cPanel (mentioned in another of your posts)?
Hope that helps
Kind regards
Alan
I created mysql db in a new private service, that database don’t have anything. I have a custom database on local pc, which I want to import to render.
I wanted to export this dumpfile, modify it and get it backup into render or if possible I can directly backup existing custom database file.
I was able to do this command on shell on render dashboard, but that dumpfile isn’t exported or downloaded. How to go forward with this 2nd, 3rd, & 4th step.
bash-4.4# mysqldump -u root -p mysql > mysql.sql
Enter password:
bash-4.4#