-1

Hi I am trying to connect my MySQL database with my Magento site.

For further information I am using Magento 1.8.1, Apache 2.2.15, MySQL 5.5, PHP 5.3.28 & PhpMyAdmin and I am using Amazon Ec2 Linux instance and I run my store in localhost.

I transferred my Magento files in to var/www/html through filezilla ftp and imported the database through phpmyadmin.

When i tried to connect my site through my public ip i get the following error please help me to solve this issue..

There has been an error processing your request
SQLSTATE[28000] [1045] Access denied for user 'ec2-user_din'@'localhost' (using password: YES)

Trace:
#0 /var/www/html/trial/lib/Zend/Db/Adapter/Pdo/Mysql.php(96): Zend_Db_Adapter_Pdo_Abstract->_connect()
#1 /var/www/html/trial/lib/Varien/Db/Adapter/Pdo/Mysql.php(320): Zend_Db_Adapter_Pdo_Mysql->_connect()
#2 /var/www/html/trial/lib/Zend/Db/Adapter/Abstract.php(459): Varien_Db_Adapter_Pdo_Mysql->_connect()
#3 /var/www/html/trial/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SET NAMES utf8', Array)
#4 /var/www/html/trial/lib/Varien/Db/Adapter/Pdo/Mysql.php(428): Zend_Db_Adapter_Pdo_Abstract->query('SET NAMES utf8', Array)
#5 /var/www/html/trial/app/code/core/Mage/Core/Model/Resource.php(169): Varien_Db_Adapter_Pdo_Mysql->query('SET NAMES utf8')
#6 /var/www/html/trial/app/code/core/Mage/Core/Model/Resource.php(110): Mage_Core_Model_Resource->_newConnection('pdo_mysql', Object(Mage_Core_Model_Config_Element))
#7 /var/www/html/trial/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(320): Mage_Core_Model_Resource->getConnection('core_write')
#8 /var/www/html/trial/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(350): Mage_Core_Model_Resource_Db_Abstract->_getConnection('write')
#9 /var/www/html/trial/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(335): Mage_Core_Model_Resource_Db_Abstract->_getWriteAdapter()
#10 /var/www/html/trial/app/code/core/Mage/Core/Model/Resource/Cache.php(53): Mage_Core_Model_Resource_Db_Abstract->_getReadAdapter()
#11 /var/www/html/trial/app/code/core/Mage/Core/Model/Cache.php(478): Mage_Core_Model_Resource_Cache->getAllOptions()
#12 /var/www/html/trial/app/code/core/Mage/Core/Model/Cache.php(520): Mage_Core_Model_Cache->_initOptions()
#13 /var/www/html/trial/app/code/core/Mage/Core/Model/App.php(1183): Mage_Core_Model_Cache->canUse('config')
#14 /var/www/html/trial/app/code/core/Mage/Core/Model/Config.php(414): Mage_Core_Model_App->useCache('config')
#15 /var/www/html/trial/app/code/core/Mage/Core/Model/Config.php(294): Mage_Core_Model_Config->_canUseCacheForInit()
#16 /var/www/html/trial/app/code/core/Mage/Core/Model/App.php(413): Mage_Core_Model_Config->loadModulesCache()
#17 /var/www/html/trial/app/code/core/Mage/Core/Model/App.php(343): Mage_Core_Model_App->_initModules()
#18 /var/www/html/trial/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#19 /var/www/html/trial/index.php(87): Mage::run('', 'store')
#20 {main}
5
  • 2
    Please check ur local.xml file
    – Keyul Shah
    Jun 28, 2014 at 8:02
  • 2
    It would probably help if you mentioned where the database came from (upgrade? migration?)
    – pspahn
    Jun 28, 2014 at 8:40
  • Hi psphan thanks for your quick reply initially i had my Magento site in my windows machine and then i exported the database from phpmyadmin and imported it to the amazon linux server.
    – megamage
    Jun 28, 2014 at 9:54
  • i checked my local.xml file it is perfect.
    – megamage
    Jun 28, 2014 at 9:55
  • 1
    Your local.xml file has incorrect credentials for MySQL. 100% guaranteed. Either correct the local.xml file in app/etc or create / reset the credentials in MySQL. If the user exists in MySQL and you reset the password, make sure you gave the user enough privileges. Also after transferring a DB keep in mind depending on how you did it, MySQL user info doesn't come with it. You may also need to flush privileges
    – espradley
    Jun 28, 2014 at 16:43

2 Answers 2

4

Check the following:

  • Disable all 3rd party modules on the server you are copying from.
  • Ensure that user ec2-user_din'@'localhost has been granted access to the database in question.

  • Make sure you have reset the file permissions for your installation according to the Magento Wiki

  • On your MySQL server, create a username, password and database name that matches the one of your previous server.

  • If you are still getting error messages, verify that the username, password and database name /app/etc/local.xml

If the above points do not work, follow this detailed Magento Wiki to move your installation and see where you went wrong.

1
  • 2
    created a new user and assigned all privileges to him and entered the new values in local.xml and my problem was solved.
    – megamage
    Aug 29, 2014 at 9:04
1

Your local.xml file has incorrect credentials for MySQL. 100% guaranteed. Either correct the local.xml file in app/etc or create/reset the credentials in MySQL. If the user exists in MySQL and you reset the password, make sure you gave the user enough privileges.

Taken from the comments. I can confirm that a password reset has worked for me.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.