Skip to main content
Topic solved
This topic has been marked as solved and requires no further attention.
Topic: Issue with access denied for user (Read 1280 times) previous topic - next topic

Issue with access denied for user

Please help me....

The application works fine on my local machine, but when I moved it to the production centos server, I got the following error below.

I already granted all privileges for 'flexprod' user as follow....

mysql> CREATE USER flexprod@localhost IDENTIFIED BY 'xxxxxx';
Query OK, 0 rows affected (0.01 sec)

mysql> GRANT ALL PRIVILEGES ON flexprod.* TO flexprod@localhost IDENTIFIED BY 'xxxxxx';
Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)

Here is the error when I tried to log in to the application via google chrome.

Error 500
Server Error

Exception Traces
This will only be displayed in DEVELOPMENT_MODE.
Error Message   SQLSTATE[HY000] [1045] Access denied for user 'flexprod'@'localhost' (using password: YES)
File   /var/www/html/flexprod/app/models/PDODb.php On Line 299
Stack Trace   1 /var/www/html/flexprod/app/models/PDODb.php(299): PDO->__construct('mysql:host=localhost;dbname=plexprod', 'flexprod', 'Flex', Array)
2 /var/www/html/flexprod/app/models/PDODb.php(1506): PDODb->connect()
3 /var/www/html/flexprod/app/models/PDODb.php(1526): PDODb->pdo()
4 /var/www/html/flexprod/app/models/PDODb.php(671): PDODb->prepare()
5 /var/www/html/flexprod/app/models/PDODb.php(1039): PDODb->buildQuery(1)
6 /var/www/html/flexprod/app/models/PDODb.php(1079): PDODb->get('users', 1, '*')
7 /var/www/html/flexprod/app/controllers/IndexController.php(28): PDODb->getOne('users')
8 /var/www/html/flexprod/app/controllers/IndexController.php(88): IndexController->login_user('thienduc',

 

Re: Issue with access denied for user

Reply #1
@kluongt‍ this means that your MYSQL server is rejecting the login details you provided for phprad to use.
1. Please make sure the username and password do not have spaces at the beginning and at the end of them.
2. Make sure you have properly created the details you are using in the MYSQL server.