LoginSignup
0
0

More than 3 years have passed since last update.

mysqldumpのよく使うオプションメモ

Last updated at Posted at 2019-09-18

mysqldumpのよく使うオプションメモ

mysqldump --single-transaction --all-databases -u root -ppassword -h localhost > /home/hoge/all_databases.sql

-u
ユーザ名

-p
パスワード

-h
ホスト名

--single-transaction
ダンプ処理をトランザクションで囲む。
データの整合性を保つのに有効だが、MyISAMテーブルが含まれるDBではトランザクションが効かないので、代わりに--lock-tablesか--lock-all-tablesを使う。
InnoDBでは--single-transactionを使った方が速い。

--all-databases
全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