2

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?

2
  • Did you try removing your entire /var/cache folder? Commented Mar 13, 2015 at 14:02
  • Yes I did. After reloading the page, the directory is created again, but left empty Commented Mar 13, 2015 at 14:05

1 Answer 1

4

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.

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

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.