Cron problem


#1

I’ve written a perl script that I’m using to update a MySQL database. The script runs fine from the command line, but I receive the error message “DBI connect(‘host=mysql.domain.com;database=xcard’,‘user_name’,…) failed: Can’t connect to MySQL server on ‘mysql.domain.com’ (111) at /home/user_name/xcard.pl line 14”

I’ve tried reading dreamhost’s documentation and I’ve tried changing the cron entry several times. Currently I’m trying to use Dreamhost’s Cron GUI. The entry I’m using looks like “/usr/local/bin/perl /home/ikari/user_name/xcard.pl”

I’ve substituted “user_name” for my user name and “mysql.domain.com” for my mysql subdomain.

Any help would be greatly appreciated.


#2

Shouldn’t the database be asking for a password? I don’t see any mention of using a password in your message.

-Scott


#3

There is a password in the script, and the script does work properly when run from the command line. I’m guessing the password isn’t put into the error message.


#4

That /home/ikari/user_name doesn’t look right. Mine shows up as /home/.blahblah/user_name, and the .blahblah part is unnecessary. It’s just a mount point that can be removed.

How about /home/user_name/file.pl?

-Scott


#5

I was prepared to say that your suggestion wasn’t going to work, but upon editing crontab, it looks like it’s running fine now for about 6 hours. I could’ve sworn this was the first thing I tried…

Thanks so much for the help!