New to Magento 2 development here. I've gone through training and am now in the process of setting up my local environment using code from our Magento Cloud instance. I've fetched the code/installed Magento locally. I then tried to do a database dump from my Cloud environment to my local. I used that to overwrite my local machine's instance of magento database. After doing that, my backend will no longer work. The browser is giving me a generic "Unable to connect" page.
The backend administration isn't working is a common issue faced by the admins. However, It shows an "Unable to connect" page, and the backend stops working.
If you encounter the following issue, you can follow the steps below to resolve the issue,
Impact of installing or updating:
You might get an error message after installing a new extension, upgrading one, or applying Magento 2 core or an extension patch.
php bin/magento cache:clean rm -rf var/cache/* rm -rf var/generation/* rm -rf generated/*
The compilation hasn't been started:
It is essential to restart the compilation when a new extension is installed in production mode. If you forget it, the backend, as well as the frontend, won't work. To fix the issue, reset the production mode again via the below command line,
php bin/magento deploy:mode:show
<strong>php bin/magento deploy:mode:set production</strong>
An incorrect Admin URL:
It might happen if you are trying to access the backend with an incorrect URL. Using the command line, you can check the correct URL for the admin panel via the below command,
php bin/magento info:adminuri
The permission role isn't set correctly:
In order to fix the issue, reset the permission role of your administrator.
I hope the above solution helps you to solve the "Backend not working in local" issue. However, if the issue persists, you can update it here.