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.

dumpファイルの取り込み(MySQL)

Last updated at Posted at 2022-04-20

概要

現場に入場してすぐの環境構築のときに上長からdumpファイルと取り込み用のコマンドが送られてきたが、dumpファイルの取り込み方が分からない、若しくはなんだか警告が気になる人向け。(mysqlコマンドの復習)

コマンド

筆者が上長から受け取ったコマンド

mysql -h(ホスト名) -P(ポート番号) -u(ユーザ名) -p(パスワード) (DB名) < (ファイル名)

なお、基本はユーザ名、パスワード、DB名でいける。他は開発環境による。
取り込み自体はできたが以下の警告文が気になる。。

mysql: [Warning] Using a password on the command line interface can be insecure.

簡単なことだが、こんな時はパスワードをコマンドに放り込んでいるのが良くない(らしい)。

mysql -h(ホスト名) -P(ポート番号) -u(ユーザ名) -p (DB名) < (ファイル名)

この後にパスワードを聞かれて、その後は警告なく実行された。

まとめ

なんてことはないが、筆者は警告文が気になるお年頃。

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?