I have a problem with Magento which for me and a problem because when I stop the Mysql service and I try to go to my web page I have this error :

PDOException: SQLSTATE[HY000] [2002] No such file or directory

which is normal but what I don't find is normal we can clearly see my mysql logins clearly on my home page as I can fix this and I also have a question why I don't have an error 404 page instead of the page with mysql logins

Thank you for your response.

1 Answer 1


If I understand your question correctly you are wondering why Magento shows an error when MySQL has been shut down instead of the 404 page?

The 404 page is stored in the database. If you shut down the database Magento can no longer load the page to display it. If anything it should show a "service unavailable" error or something similar. Is your site in production mode? If it is in developer mode then it it designed to show errors instead of hide them.

You can customise the Maintenance page by following these instructions How can I display a custom maintenance message on Magento 2.2.4

  • Thank you for your help but this happens in my UAT site which is a copy of the production site and therefore if I follow the procedure I would no longer have the page with the mysql errors? I have another question also how to know if it is in developer mode
    – FUSS93
    Sep 15, 2022 at 15:04
  • 1
    Hi , to know what mode is your magento you can execute this via command line = "bin/magento deploy:mode:show", this command will let you know if you are in developer mode , production mode or default mode.If you want to switch between modes , first enable the maintenance mode and run this commands = "bin/magento deploy:mode:set developer" or to go to production "bin/magento deploy:mode:set production" like this you can follow.To enable maintenance mode = "bin/magento maintenance:enable" to disable it just replace it to disable.Please do give me a like , if this helps you , it also does to me Sep 15, 2022 at 17:46
  • 1
    Hi, thx for you help, yes it was in developer mode
    – FUSS93
    Sep 15, 2022 at 18:08

Your Answer

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

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