[clue] MySQL Question

Raymond DeRoo rderoo at deroo.net
Fri Nov 30 16:52:30 MST 2012


Warren:

> I've inherited a complex LAMP application.

Well the below MySQL commands would lead me to believe that some of the complexity is needless. 

> 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"

As it takes a root equivalent user to issue these commands and a host has been specified I would say that you should look into performing a security audit of at least your MySQL part, and probably the whole stack. 

"reset master" really serves no useful purpose, unless there is some other script that makes use of the fact that the binary log is now .000001 position 4. This fact will cause all kind of havoc if replication ever comes into being. I would recommend investigaing if it can be removed and doing so if at all possible.

As for the "flush logs" the behavior that depends upon the version of MySQL you are using. http://dev.mysql.com/doc/refman/<major>.<minor>/en/flush.html would be your best resource.

> What does "reset master" and "flush logs" do to a running database?  At
> no time does the script stop and restart the instances, BTW.

I'm curious what your mysqldump command line looks like as well.

Best Regards,
Raymond
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://cluedenver.org/pipermail/clue/attachments/20121130/0f6989cc/attachment-0001.html 


More information about the clue mailing list