[clue] MySQL Question
adam bultman
adamb at glaven.org
Fri Nov 30 18:41:41 MST 2012
On 11/30/2012 02:42 PM, Jason Friedman wrote:
>> I've inherited a complex LAMP application.
>>
>> A script runs nightly to dump the databases for a backup. After the
>> dumps and before emailing the results, the script issues the following
>> commands on each database:
>>
>> mysql -u <user> -p<password> -h <DB Server> -e "reset master"
>> mysql -u <user> -p<password> -h <DB Server> -e "flush logs"
>>
>> What does "reset master" and "flush logs" do to a running database? At
>> no time does the script stop and restart the instances, BTW.
Reset master: Removes all the binary logs.
Flush logs: Closes and reopens all log files.
It might make more sense to reset the master after *all* DB dumps are
complete; because you could in theory lose changes that were made
mid-backup process. Flush logs seems near pointless.
Like Raymond said, if replication is being used, it's a big no-no. If I
issue that command on my master MySQL server, I made myself a lot of work.
You might spend some time 'auditing' this complex application to see if
some of the complexity is the result of a lack of knowledge on the
previous admin's part. I've inherited a lot of those, and most
certainly left some of those types of things behind, personally.
More information about the clue
mailing list