cron problem

I have problem with cron
When I redirect cron message to email, I got:

Fatal error: Uncaught Exception: Unable to connect to the database. Details have been saved in the SuiteCRM log (0). in /home/xxxx/public_html/xxxxxx.pl/SuiteCRM/include/utils.php:1773
Stack trace:
#0 /home/xxxx/public_html/xxxxxx.pl/SuiteCRM/include/database/MysqliManager.php(310): sugar_die(‘Nie mo\xC5\xBCna po\xC5\x82…’)
#1 /home/xxxx/public_html/xxxxxx.pl/SuiteCRM/include/database/DBManagerFactory.php(147): MysqliManager->connect(Array, true)
#2 /home/xxxx/public_html/xxxxxx.pl/SuiteCRM/include/entryPoint.php(188): DBManagerFactory::getInstance()
#3 /home/xxxx/public_html/xxxxxx.pl/SuiteCRM/cron.php(45): require_once(’/home/xxxx/p…’)
#4 {main}
thrown in /home/xxxx/public_html/xxxxxx.pl/SuiteCRM/include/utils.php on line 1773

BTW, SuiteCRM works fine

Any idea ?

What is your version of SuiteCRM?

How exactly did you set up the cron jobs?

If you go in Admin / Schedulers, and go into a specific job,do you see “Last ran successfully” as a recent time? Or “Never”?

And this error you posted above, it mentions that there is more info in suitecrm.log. What do you find there, at this same time?

v. 7.10.4
Last ran successfully - february this year

log
Thu May 3 11:07:01 2018 [3][-none-][FATAL] Could not connect to DB server localhost as maciogg_www-data. port : Access denied for user ‘maciogg_www-data’@‘localhost’ (using password: YES)
Thu May 3 11:08:01 2018 [3][-none-][FATAL] Could not connect to DB server localhost as maciogg_www-data. port : Access denied for user ‘maciogg_www-data’@‘localhost’ (using password: YES)
Thu May 3 11:09:02 2018 [3][-none-][FATAL] Could not connect to DB server localhost as maciogg_www-data. port : Access denied for user ‘maciogg_www-data’@‘localhost’ (using password: YES)
Thu May 3 11:10:06 2018 [3][-none-][FATAL] Could not connect to DB server localhost as maciogg_www-data. port : Access denied for user ‘maciogg_www-data’@‘localhost’ (using password: YES)

Is your database on localhost?

Are your php.ini settings correct for database? Note that they can be correct for the SuiteCRM app, but incorrect for the Schedulers, since they run from a different PHP (CLI - command line).

Check your php.ini path with this command

php -i | grep php.ini

And check if you can login to your database with that user name from mysql command-line.