Skip to content

Fixed global parameters skipped #811

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 28, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions templates/mysqlbackup.sh.erb
Original file line number Diff line number Diff line change
Expand Up @@ -70,18 +70,18 @@ cleanup
<% if @file_per_database -%>
mysql --defaults-file=$TMPFILE -s -r -N -e 'SHOW DATABASES' | while read dbname
do
mysqldump --defaults-file=$TMPFILE --opt --flush-logs --single-transaction \
mysqldump --defaults-extra-file=$TMPFILE --opt --flush-logs --single-transaction \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What versions of mysql support the --defaults-extra-file?

More so what version was it introduced? And what is the use case? Could you elaborate?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--defaults-extra-file present in docs since 5.0 http://dev.mysql.com/doc/refman/5.0/en/mysqldump.html#option_mysqldump_defaults-extra-file. I can't find confirmation for earlier versions quickly.

I faced the problem that mysql backup script can't find socket file. It was caused by mysql built from sources.

Temporary fix for that situation was rollback to 3.6.1 module.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have any issues with this and I'm not too worried about the installations of version < 5.0.

Any objections @cyberious ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 from me, anyway

${ADDITIONAL_OPTIONS} \
${dbname} <% if @backupcompress %>| bzcat -zc <% end %>> ${DIR}/${PREFIX}${dbname}_`date +%Y%m%d-%H%M%S`.sql<% if @backupcompress %>.bz2<% end %>
done
<% else -%>
mysqldump --defaults-file=$TMPFILE --opt --flush-logs --single-transaction \
mysqldump --defaults-extra-file=$TMPFILE --opt --flush-logs --single-transaction \
${ADDITIONAL_OPTIONS} \
--all-databases <% if @backupcompress %>| bzcat -zc <% end %>> ${DIR}/${PREFIX}`date +%Y%m%d-%H%M%S`.sql<% if @backupcompress %>.bz2<% end %>
<% end -%>
<% else -%>
<% @backupdatabases.each do |db| -%>
mysqldump --defaults-file=$TMPFILE --opt --flush-logs --single-transaction \
mysqldump --defaults-extra-file=$TMPFILE --opt --flush-logs --single-transaction \
${ADDITIONAL_OPTIONS} \
<%= db %><% if @backupcompress %>| bzcat -zc <% end %>> ${DIR}/${PREFIX}<%= db %>_`date +%Y%m%d-%H%M%S`.sql<% if @backupcompress %>.bz2<% end %>
<% end -%>
Expand Down