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 1 year has passed since last update.

MySQL dumpファイルを出力する

Last updated at Posted at 2020-11-29

目的

  • MySQLのdumpファイルの出力方法をまとめる

前提情報

  • 特定のDBのdumpファイルを出力する。

詳細

  • 下記を実行するとカレントディレクトリに「出力されるdumpファイル名」のファイルが出力される。MySQLのユーザパスワードの入力を求められたら入力する。※出力されるdumpファイル名は拡張子も指定する。

    mysqldump --single-transaction -u DBユーザ名 -p DB名 > 出力されるdumpファイル名
    
  • --single-transactionのオプションは「このオプションは、サーバーからデータをダンプする前に BEGIN SQL ステートメントを発行」らしい。言うなればdumpファイルを出力するときに処理がトランザクションで囲まれる。

参考文献

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?