如何在Heroku中使用ClearDB中的Mysql命令? [英] How to use Mysql commands with ClearDB in Heroku?

查看:182
本文介绍了如何在Heroku中使用ClearDB中的Mysql命令?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将 ClearDB Heroku 一起使用。
我设法完成了我需要的迁移,但是当我找不到使用终端执行查询的方式时:

从表选择*。



预先致谢。

解决方案

格式:

  mysql -h主机-uuser -ppassword 

示例:

  mysql -h us-cdbr-east.cleardb.com -ubxxxxxx7 -p3xxxxxxx 

如何查找登录信息



在你的heroku repo中使用这个命令: heroku config



寻找 CLEARDB_DATABASE_URL



格式:

  mysql:// ** user **:** password ** @ ** host ** / heroku_db_name?... 

示例:

  mysql:// bxxxxxx7:3xxxxxxx@us-cdbr-east.cleardb.com / heroku_xxxxxx?... 

连接后,只需 USE heroku_db_name 并查询!


I'm using ClearDB with Heroku. I managed to make the migrations that I needed but when I can't find the way to execute queries using the terminal as below:

SELECT * from table .

Thanks in advance.

解决方案

Format:

mysql -h host -uuser -ppassword

example:

mysql -h us-cdbr-east.cleardb.com -ubxxxxxx7 -p3xxxxxxx

How to find login info

Use this command in your heroku repo: heroku config

Look for the CLEARDB_DATABASE_URL

Format:

mysql://**user**:**password**@**host**/heroku_db_name?...

Example:

mysql://bxxxxxx7:3xxxxxxx@us-cdbr-east.cleardb.com/heroku_xxxxxx?...

After connecting, just USE heroku_db_name and query away!

这篇关于如何在Heroku中使用ClearDB中的Mysql命令?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆