Hello,
I'm facing an odd issue where I can not run cron.php from within my sugarcrm directory. My primary issue is group e-mails not populating the inbox but after extensive research I've found myself focusing on the scheduler and cron task as that seems to be the most common fix.
When trying to manually run cron.php I receive the following error:
$ sudo php -f cron.php
PHP Warning: mysqli_connect(): (42000/1049): Unknown database 'sugarcrm' in /opt/sugarcrm-6.3.0/htdocs/sugarcrm/include/database/MysqliManager.php on line 297
Could not connect to the database. Please refer to sugarcrm.log for details.
Checking my sugarcrm.log I see this:
$ tail -n 1 sugarcrm.log
Tue Dec 20 16:14:01 2011 [10564][-none-][FATAL] Could not connect to DB server localhost as root. port : Unknown database 'sugarcrm'
This to me would indicate the incorrect database information in config.php but a quick look shows that it appears to be accurate from my understanding:
Just to be safe, I checked the DB information in phpMyAdmin and it appears to match:Code:'dbconfig' => array ( 'db_host_name' => 'localhost', 'db_user_name' => 'root', 'db_password' => '*********', 'db_name' => 'sugarcrm', 'db_type' => 'mysql', )
Server version: 5.0.37
Protocol version: 10
Server: Localhost via UNIX socket
User: root@localhost
MySQL client version: 5.0.37
I also verified the user privileges for the sugarcrm database. One odd thing I noticed is when manually logging into MySQL via CLI I don't see a SugarCRM database:
$ mysql -u root -p
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
+--------------------+
2 rows in set (0.00 sec)
I thought perhaps this was because MySQL was bundled with the distro and running. I saw a mysqld process running so I killed the process and was still able to access my SugarCRM database via the application and phpMyAdmin. Next I tried running cron.php again but received this error:
PHP Warning: mysqli_connect(): (HY000/2002): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in /opt/sugarcrm-6.3.0/htdocs/sugarcrm/include/database/MysqliManager.php on line 297
Could not connect to the database. Please refer to sugarcrm.log for details.
Needless to say, I could not even access MySQL via CLI as it appeared the server needed to be running and was not conflicting:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
I've tried specifying a different host in config.php such as localhost but to no avail. I've tried every forum post I could find but still no luck. Any suggestions would greatly be appreciated! My SugarCRM system works just fine with an exception to this cron error and the group-email issue which I assume is related. I already have my crontab setup but it's not of any use until I get cron.php working properly. Went as far as running repairs but no luck :/
I've attached a copy of my phpinfo and config.php that I obtained through the diagnostic section of SugarCRM. Oddly enough, phpinfo shows mysql.default_password and mysql.default_port as having no values even though they are explicitly defined within php.ini in the SugarCRM directory.
My current setup:
OS: Ubuntu 11.10 Server i386 (Was using CentOS but had the same issue).
SugarCRM: Used FastStack Linux Installer 6.3.1 (Apache, MySQL, PHP installed through the FastStack).
Network: LAN
Thanks again!


LinkBack URL
About LinkBacks



Reply With Quote

Bookmarks