0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

RailsのWebサーバーからMySQLのCLIに繋ぎたい

Last updated at Posted at 2020-05-29

この記事について

自分用メモです。

メモ

# RAILS_ENVには環境名を入れる
# dbはdbconsoleでも可。
RAILS_ENV=production bundle exec rails db
> passwordを入力

# デフォルトの出力だと見にくいのでlessで結果を見る
mysql> pager less -n -i -S

# 見たいdatabaseに切り替える
mysql> use `hoge-database`;

# 見たい結果を得るためのクエリ
mysql> select * from hoge_table;
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?