2
votes

I tried to access the index page of my website: index.php, via this link: localhost:80/web/index.php. This brought me to a blank page on chrome that shows the error result:

Warning: Declaration of SugarDateTime::setTime($hour, $minute, $sec = 0) should be compatible with DateTime::setTime($hour, $minute, $second = NULL, $microseconds = NULL) in C:\xampp\htdocs\uat\include\SugarDateTime.php on line 692 Could not connect to the database. Please refer to simplecrm.log for details.

I checked the "simplecrm.log" file, it showed me the error:

Could not connect to DB server localhost as jobportal. port : Access denied for user 'jobportal'@'localhost' (using password: YES)

I have scoured the internet for answers, especially:

But these answers only show the root user, while my issue refers to the "jobportal" user. I did try the solutions given but I still can't solve this issue.

Here is the code in index.php:

include ('include/MVC/preDispatch.php');
$startTime = microtime(true);
require_once('include/entry.php');
ob_start();
require_once('include/MVC/SugarApp.php');
$app = new SugarApp();
$app->startSession();
$app->execute();
2
what os you're on and what stack you're using??popeye
I'm using windows 7, and using xampp. I tried wampserver but it has the same errorDenise
Did you create a user account called jobportal? Did you give that new account access to the database you are using? Did you give that account the same password you are using in your code?RiggsFolly
@RiggsFolly yes, already done that. This user isn't the root user. Do I have to edit anything in the config.inc.php file?Denise
Not sure about XAMPP, but WAMPServer's phpMyAdmin throws a login screen that asks for a UserId and Password so you dont need to amend the config.inc.php file. You can use any valid UserId/Password pair to login to MySQL from phpMyAdmin.RiggsFolly

2 Answers

1
votes

If you set your database password then write like

$db_name = 'dbname';
$db_pass = 'yourPasss';

Else 
$db_name = 'dbname';
$db_pass = ''; //empty
0
votes

Try granting all privilages on the database to user jobportal using the following SQL, like so:

GRANT ALL PRIVILEGES ON your_database.* TO 'jobportal'@'localhost' 
IDENTIFIED BY 'your_db_password';

After executing the above, execute the following:

FLUSH PRIVILEGES;