How to download MySQL db from C9?



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 '' (111) when trying to connect

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


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 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…



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


Thanks 556!

But it weird there are upvoted answers on SO recommending mysqldump for cloud9.

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


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