我正在尝试将我的node.js应用程序托管在云9服务器 http://c9.io。为了建立 mysql 连接,我需要知道主机地址。
这一页 https://docs.c9.io/setting_up_mysql.html以一种非常荒谬的方式(我认为我是对的)说:
Hostname $IP The same local IP as the application you run on Cloud9
但是我从哪里获得本地IP呢?我在文档中没有找到它。任何想法 ?
EDIT :我使用 127.0.0.1 , 0.0.0.0( 来自echo $IP
按照答案中的建议在终端中)以及来自的值hostname -I
and curl curlmyip.com
在终端中。 4 个不同的 IP 地址。没有一个起作用。
我在Cloud9 文档 https://docs.c9.io/setting_up_mysql.html:
然后您可以使用以下参数连接到数据库:
Option Value Comment
Hostname $IP The same local IP as the application you run on Cloud9
Port 3306 The default MySQL port number
User $C9_USER Your Cloud9 user name
Password - No password since you can only access the DB from within the workspace
Database c9 The database name
要查找您的 IP 地址,请打开您的工作区并在 bash 控制台中输入以下内容:
curl http://curlmyip.com/
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)