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.

mysqldumpで空ファイルしかできないと思ったら

Last updated at Posted at 2020-11-24

mysqldumpで空ファイルしかできないと思ったら

背景

MySQLでdumpファイルを作りたくmysqldump -uroot -p データベース名 > ファイル名.sqlのコマンドを打っているのにできるのは中身が空のファイル。
今までできていたのに何故???

原因

単純なコマンドミスだった。
dumpファイル(空だが)自体は作成できていたため、指摘してもらうまでコマンドミスをしていることに全く気付かなった。

mysql -uroot -p データベース名 > ファイル名.sqlでdumpの空ファイルはできる

  • 間違い
    mysql -uroot -p データベース名 > ファイル名.sql

  • 正解
    mysqldump -uroot -p データベース名 > ファイル名.sql

mysqldumpと入力するべきところをmysqlと入力していた。

思い込むとなかなか気付けないこのミス。
空ファイルしかできなくて困ったときには一度コマンドを見直してみてください。

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?