"MySQL server has gone away". Hmm.
I am using vagrant and chef to setup my virtual development environment. I'm almost there, but on the last step chef fails when attempting to execute my external db_setup.sql file. I can execute this same script by SSH'ing into the virtual server and it installs without difficulty.
This is my problem code (in cookbooks/database/recipies/mysql.rb file):
# Query a database from a sql script on disk
mysql_database 'run script' do
database_name 'my_db'
connection mysql_connection_info
retries 3
sql { ::File.open('/vagrant/db_setup.sql').read }
action :query
end
The file is 6.9mb and the error I receive when I run vagrant provision
is:
==> default: [2014-08-24T16:04:53-07:00] ERROR: mysql_database[run script]
(database::mysql line 50) had an error: Mysql::Error: MySQL server has gone away
For what it's worth, when I replace the db_setup.sql file with a smaller, simpler file that just creates a few empty tables, it executes without difficulty.
Any suggestions? Thank you in advance!