You are here: Re: PHP, MySQL and crontab « PHP Programming Language « IT news, forums, messages
Re: PHP, MySQL and crontab

Posted by Jerry Stuckle on 12/16/44 11:57

Sandman wrote:
> I have a PHP cli script, that backups my databases, using mysqldump
> via system().
>
> When logged in with SSH, and launching the script with "./backup.php",
> all works just as it should, but when I put it in a crontab:
>
> 00 2 * * * /home/sandman/bin/backup.php
>
> I get a mail that says:
>
> "mysqldump: Got error: 2002: Can't connect to local MySQL server
> through socket '/var/run/mysqld/mysqld.sock' (2) when trying to
> connect"
>
> How come? Anyone knows what the difference is between CLI and crontab
> that could cause this?
>

Well, for one thing, what's the user you have set up for your cron job?
Does it have permission to use the socket? Is it using the correct
socket?

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация