How to download MySQL db from C9?

mysql

#1

I tried downloading a db copy with,

mysqldump -u username -p databasename > backup.sql

It asks for a password. My understanding is that there is none, so I pressed enter.

The response is,

mysqldump: Got error: 2003: Can't connect to MySQL server on '0.0.0.0' (111) when trying to connect

I’m probably missing something simple here. Does anyone have experience doing this?


#2

Firstly I had to run,
mysql-ctl cli

But I’m still getting an error when run this,
mysqldump -u <username> c9 > backup.sql

Error:

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near…

Thoughts?


#3

mysqldump is not a mysql client environment command, but Linux shell command.


#4

Thanks 556!

But it weird there are upvoted answers on SO recommending mysqldump for cloud9.
Ie: http://stackoverflow.com/questions/25588741/how-can-i-export-a-mysql-database-from-cloud9

Do you know what the command is for the c9 environment?


#5

Do you note quit; in the upvoted answer you mentioned about?
It implies we finally exit the mysql cti environment and run the mysqldump under Linux terminal.

Above all, just run mysqldump <DB name> > backup.sql
And then you can downlad backup.sql by yourself through the c9 IDE UI.

P.S. add a screenshot