How to connect to the process running on 'localhost' that is inside of cloud9 server

后端 未结 5 1325
既然无缘
既然无缘 2021-01-02 09:58

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

5条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-02 10:23

    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.

提交回复
热议问题