Help us understand the problem. What is going on with this article?

mysqldumpでバイナリデータを扱う場合のオプション

More than 1 year has passed since last update.

やったこと

BLOB型やGEOMETRY型も含めたデータを移行する必要があったのでその時に使ったオプションです。
次やる時には絶対忘れそうなところなので、残しておこうかと。

オプション名 説明
--hex-blob バイナリカラムを 16 進変換表記法を使用してダンプ

実際のコマンド

バックアップ作成

mysqldump -h ホスト名 -u ユーザ名 -p データベース名 --hex-blob > dump_data.sql

データ登録

mysql -h ホスト名 -u ユーザ名 -p データベース名 < dump_data.sql

参考:

mysqldumpでバックアップをする時につけるオプション
http://oinume.hatenablog.com/entry/wp/292

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away