I accidentally overwrote /app/etc/local.xml with a version from another host. No live shop affected, luckily, but I can't get the shop to connect to the database anymore. It keeps saying:

There has been an error processing your request

SQLSTATE[HY000] [1045] Access denied for user 'wronguser'@'localhost' (using password: YES)

I've restored the correct local.xml, with the correct database settings. I cleared var/cache and var/sessions.

When running n98-magerun db:console I can access the database, but it's impossible to run n98-magerun cache:clean or any other database related command.

Removing any other .xml files from /app/etc/ didn't resolve the issue either. grep -R wronguser * didn't even find the wrong database connection in the entire document root. I have no idea where Magento gets this information from.

Any thoughts?

  • Did you try removing your entire /var/cache folder? – Arjen Miedema Mar 13 '15 at 14:02
  • Yes I did. After reloading the page, the directory is created again, but left empty – dvdmierden Mar 13 '15 at 14:05

If cache folder stays empty - it might be that Redis cache backend is used. Then you'll have to connect to Redis CLI and flush caches there to make Magento re-read settings from local.xml.

  • 1
    I really should've thought of that! You're a life saver:) redis-cli -n 0 flushdb did the trick! – dvdmierden Mar 13 '15 at 14:42
  • Glad to help :) – DmitryR Mar 13 '15 at 15:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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