[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cobalt-developers] Cron job to backup MySQL



"Jay Nelson" <jay@xxxxxxxxxxx> wrote:
> I have a short PERL script that executes mysqlhotcopy
> which works fine from the command line when logged
> in as root.  I put the root MySQL password in the
> /root/.my.cnf file.  When the cron job runs (cron.daily)
> it fails using no password saying that root@localhost
> is not authorized.  What gives?  How do I get the cron
> job to recognized the .my.cnf file containing the password?

Jay, I run mysqldump from a bash shell script I wrote in conjunction with a
.my.cnf file in /root containing the MySQL login info. and it works fine.  I
do so from the user cron, not the system cron (which is what you used).
Since you say that running it from the commandline works, I think we can
rule out permissions and ownership of /root/.my.cnf as a problem (you were
talking about running the Perl script from the commandline, not mysqlhotcopy
directly, right?).  I'd advise setting up a user cron entry for root and
seeing if it works that way.

--
Steve Werby
President, Befriend Internet Services LLC
http://www.befriend.com/