Mysql和Nitrious IO(Mysql and Nitrious IO)

我刚在Nitrous IO中创建了一个导轨盒。 Rails盒预定义使用sqlite3,但我想使用mysql2。 由于我无法使用框中的mysql,因为它会触发无法连接到套接字的错误,因此可以将该框连接到Heroku中的免费数据库服务。 我在Heroku中创建了一个帐户,并从我的框中登录到heroku。 我在将数据库(cleardb)链接到NitrousIO中的rails框时遇到问题,因为它们只显示链接postgres db的过程。

我的database.yml文件包含以下内容:

development: adapter: mysql2 encoding: utf8 database: testdb_development pool: 5 username: root password: host: localhost

I just created a rails box in Nitrous IO. Rails boxes come predefined to use sqlite3 but I want to use mysql2. Since I can't use mysql from the box because it fires up an error that it can't connect to a socket, they can connect the box to a free database service in Heroku. I created an account in Heroku, and logged in from my box to heroku. I am having problems linking the database (cleardb) to the rails box in NitrousIO, since they only show procedure to link a postgres db.

My database.yml file has the following:

development: adapter: mysql2 encoding: utf8 database: testdb_development pool: 5 username: root password: host: localhost

最满意答案

您是否已在database.yml文件中配置开发设置? 您需要更改上面列出的主机,用户名和密码字段,以匹配您的cleardb设置。

这是另一篇文章,说明如何检索主机数据库URL: 远程连接到clearDB heroku数据库

在顶部角落单击Addons,然后选择ClearDB MySQL Database。 在那里,单击您的数据库并选择“端点信息”选项卡。 在那里你看到你的用户名/密码。 可以通过运行heroku config --app获取数据库的URL

就我而言,它是这样的:mysql:// user:pass@us-cdbr-east.cleardb.com/TABLE?reconnect = true你需要的是这部分:us-cdbr-east.cleardb.com

Did you already configure the development settings within the database.yml file? You will need to change the host, username, and password fields which you listed above to match the settings of your cleardb.

Here is another post which states how to retrieve your host database URL: Remote connect to clearDB heroku database

On the top corner click on Addons and then select ClearDB MySQL Database. Once there, click on your database and choose the 'Endpoint Information' tab. There you see your username/password. The URL to the database can be acquired by running heroku config --app

In my case, it was something like: mysql://user:pass@us-cdbr-east.cleardb.com/TABLE?reconnect=true What you need is this part: us-cdbr-east.cleardb.com

Mysql和Nitrious IO(Mysql and Nitrious IO)

我刚在Nitrous IO中创建了一个导轨盒。 Rails盒预定义使用sqlite3,但我想使用mysql2。 由于我无法使用框中的mysql,因为它会触发无法连接到套接字的错误,因此可以将该框连接到Heroku中的免费数据库服务。 我在Heroku中创建了一个帐户,并从我的框中登录到heroku。 我在将数据库(cleardb)链接到NitrousIO中的rails框时遇到问题,因为它们只显示链接postgres db的过程。

我的database.yml文件包含以下内容:

development: adapter: mysql2 encoding: utf8 database: testdb_development pool: 5 username: root password: host: localhost

I just created a rails box in Nitrous IO. Rails boxes come predefined to use sqlite3 but I want to use mysql2. Since I can't use mysql from the box because it fires up an error that it can't connect to a socket, they can connect the box to a free database service in Heroku. I created an account in Heroku, and logged in from my box to heroku. I am having problems linking the database (cleardb) to the rails box in NitrousIO, since they only show procedure to link a postgres db.

My database.yml file has the following:

development: adapter: mysql2 encoding: utf8 database: testdb_development pool: 5 username: root password: host: localhost

最满意答案

您是否已在database.yml文件中配置开发设置? 您需要更改上面列出的主机,用户名和密码字段,以匹配您的cleardb设置。

这是另一篇文章,说明如何检索主机数据库URL: 远程连接到clearDB heroku数据库

在顶部角落单击Addons,然后选择ClearDB MySQL Database。 在那里,单击您的数据库并选择“端点信息”选项卡。 在那里你看到你的用户名/密码。 可以通过运行heroku config --app获取数据库的URL

就我而言,它是这样的:mysql:// user:pass@us-cdbr-east.cleardb.com/TABLE?reconnect = true你需要的是这部分:us-cdbr-east.cleardb.com

Did you already configure the development settings within the database.yml file? You will need to change the host, username, and password fields which you listed above to match the settings of your cleardb.

Here is another post which states how to retrieve your host database URL: Remote connect to clearDB heroku database

On the top corner click on Addons and then select ClearDB MySQL Database. Once there, click on your database and choose the 'Endpoint Information' tab. There you see your username/password. The URL to the database can be acquired by running heroku config --app

In my case, it was something like: mysql://user:pass@us-cdbr-east.cleardb.com/TABLE?reconnect=true What you need is this part: us-cdbr-east.cleardb.com