Dump sql file to ClearDB in Heroku
https://stackoverflow.com/questions/11803496/dump-sql-file-to-cleardb-in-heroku/11803685
Last updated
Was this helpful?
https://stackoverflow.com/questions/11803496/dump-sql-file-to-cleardb-in-heroku/11803685
Last updated
Was this helpful?
Asked 7 years, 5 months agoActive Viewed 12k times1516
I have a sql file that I want to be dumped into a MySQL database that I have in Heroku using the ClearDB addon. When dumping in local I do the following:
However, I don't have any clue on how to dump it to the Heroku MySQL database. All I know is this address:
But if I try to do:
I get No such file or directory
.
How am I supposed to do it? 15.2k22 gold badges5353 silver badges7070 bronze badgesasked Aug 3 '12 at 21:2420k4545 gold badges124124 silver badges228228 bronze badges
1When dumping in local you probably do >
and not <
, as the latter will actually restore and overwrite mydatabasename
. –
You don't "dump into", you "dump out of" a database. Then you "restore" a database from a dump. –
33
You might be able to do something like this
It doesn't work for me on the new version of mysql. So I tried following code:
answered Aug 3 '12 at 21:4115.2k22 gold badges5353 silver badges7070 bronze badges
Thanks for that! I didn't use the command line, but it worked perfectly when I connected remotely with Sequel Pro. You're a lifesaver. –
3use heroku config
to get the CLEARDB_DATABASE_URL which contains the info you need for this command, in the format: mysql://user:password@host/heroku_db?reconnect=true
. In this case: mysql://b5xxxxx7:37d8faad@us-cdbr-east.cleardb.com/heroku_xxxxxx?reconnect=true
–
I tried following your comment but it gave me this error: REFERENCES command denied to user 'baexxxxxxxxxxx'@'ec2-54-165-50-141.compute-1.amazonaws.com' for table 'ycdb.recipe'
Any ideas on how to solve this? –
2
and then it asks your password.answered Sep 9 '15 at 23:191,0961111 silver badges1818 bronze badges