0
Environment
- Ubuntu 12.04 Precise64
- Enterprise Chef
- opscode-cookbooks/mysql
- opscode-cookbooks/database
- Wordpress 3.9
Objective
I am trying to replicate/clone my production Wordpress server.
I'd to be able to create a dump of the remote database
mysqldump --databases my_database > dump.sql
and restore
mysql -u my_user -p -D my_database < dump.sql
I have tried this without success:
mysql_anybots_connection_info = {
:host => 'localhost',
:username => 'my_user',
:password => "my_password"
}
mysql_database "my_database" do
connection mysql_connection_info
sql "source /path/dump.sql;"
end
and this
mysql_database "my_database" do
connection mysql_connection_info
sql { ::File.open("/pul/dump.sql").read }
action :query
end
Which worked even less?
Any suggestions?
1Actually the latter one should work. "works even less" is a very bad error description. What's the error message that chef emits? Or is there no error message, but your log is empty? Please paste your log output in doubt. – StephenKing – 2014-07-30T01:55:07.580
Hey StephenKing, You are right to ask for the logs, but don't be picky on the english. – zabumba – 2014-07-30T23:45:07.417
Oh, I didn't want to complain about the English. Sorry, if it sounds so. It's only that "does not work" style statements don't help us readers while helping you. – StephenKing – 2014-07-31T00:16:59.133
try adding -c to mysqldump I forgot why, but it works for me. – cybernard – 2014-08-01T03:11:15.487