Mautic Community Forums

CronJob Error

I’m setting up Mautic on a local environment for testing using Mac OSX.



When I use terminal to manually fire: the cronjobs listed here:https://www.mautic.org/docs/setup/index.html



I end up getting a sql error:

Code:
[PDOException] SQLSTATE[HY000] [2002] No such file or directory

mautic:leadlists:update [-b|–batch-limit[="…"]] [-m|–max-leads[="…"]] [-i|–list-id[="…"]] [-f|–force]


Because I get the "mastic:leadlists:update...." it tells me my path is correct. Any ideas on how I can resolve this before listing in CronTab?

I’m setting up Mautic on a local environment for testing using Mac OSX.

When I use terminal to manually fire: the cronjobs listed here:https://www.mautic.org/docs/setup/index.html

I end up getting a sql error:


  [PDOException]                                    
  SQLSTATE[HY000] [2002] No such file or directory  
                                                    
mautic:leadlists:update [-b|--batch-limit[="..."]] [-m|--max-leads[="..."]] [-i|--list-id[="..."]] [-f|--force]

Because I get the “mastic:leadlists:update…” it tells me my path is correct. Any ideas on how I can resolve this before listing in CronTab?

How does your command look like?

Hey,

I managed to figure this out.

In the config.php, Mautic was trying to connect to mysql using the the host: localhost. By updating to 127.0.0.1 and clearing the cache, this problem was solved.

In case someone else finds this and the current answer did not fix the problem: Another possible issue might be your path to PHP, so make sure you use the full path to php, for example:

/usr/bin/php <full_path_to_mautic>/app/console <mautic_command>

FYI: I had this issue while testing on localhost