I have a Javascript project that I work on in cloud9 IDE online, and I wanted to test my code using testem npm module: npmjs.org/package/te
I know this is a really late response, but I get the feeling that you simply just need the right hostname and you'll be in business. My method for getting C9's hostname is as follows:
If you open up a terminal and access the mysql command line by typing in
mysql-ctl start
followed by
mysql-ctl cli
which will take you to the MySQL command line interface, and then you can run this query:
SHOW VARIABLES WHERE Variable_name = 'hostname';
It will give you back your hostname under the column hostname which should look something like this:
yourUsername-yourProjectName-XXXXXXX
where the X's form a 7 digit number. You can use that as your hostname instead of localhost or 127.0.0.1 (which have never worked for most people and I'm not sure why people on other SO posts consistently suggest those). I have used this hostname before to sync my PHP scripts with my MySQL databases (before C9 implemented a built-in phpMyAdmin), and always had success with it.