If you get a mysql error when running the cron job, like “MySQL error! Error establishing a database connection!", try using ‘127.0.0.1′, instead of ‘localhost’ as host name in _basic.config.php, because PHP treats these two values differently:
- ‘localhost’ means that PHP will try using a named pipe to connect to the database. This is usually faster but is prone to breakage due to permissions (what happens when the CLI and web versions of PHP run under different system users)
- ‘127.0.0.1′ means that PHP will try using TCP/IP to connect to the database. Unless your host has disabled that MySQL feature, this is the most resilient connection method.