2
2

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 5 years have passed since last update.

mysqldumpを特定のテーブルに対して条件付きで取得する方法の備忘録

Posted at

mysqldump -u [ユーザ名] -p -t [テーブル名] --where='カラム名'='xxxx'
で取れます。

LIKE句を使いたい場合は、
mysqldump -u [ユーザ名] -p -t [テーブル名] --where LIKE 'カラム名'='xxxx'

取得するダンプにバイナリデータが含まれている場合は上記に続けて、
--hex-blobと付けると良いです。
稼働中のDBに対して行う場合は、--single-transactionを付けることでダンプ取得中のテーブルへの更新を抑止可能。

2
2
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
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?