LoginSignup
0
1

More than 5 years have passed since last update.

MySQLでのデータインポート時にMySQL server has gone away

Posted at

vagrant + ansible でDBの初期処理として、各種データをインポートしている時に、
「MySQL server has gone away」とエラーが発生してしまった時の対応メモ。

ググると、max_allowed_packetについての記事がたくさん出てくるが、
実はmax_allowed_packetにはサーバ側の設定とクライアント側の設定がある。

https://dev.mysql.com/doc/refman/5.6/ja/packet-too-large.html
https://dev.mysql.com/doc/refman/5.6/ja/packet-too-large.html

というわけで、

サーバ側
[mysqld]
max_allowed_packet=128M

クライアント(インポートする時のコマンド)
mysql --max_allowed_packet=128M < /XXXXX.sql

で解決。

0
1
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
1