Magento 2 Localhost Admin not opened, Database & Files Taken From Server

If you are taking Magento2 [Files + Database] from server & setup on localhost & while trying to open Admin , It will be not opened, due to cookie domain values specified for a particular domain name.

Solution: There are following below command need to ben run

[1]-: Run select query , to check how many cookie domain values are present in Database

select * from core_config_data 
WHERE path = "web/cookie/cookie_domain"

[2]-: Run update query:

To update all path = “web/cookie/cookie_domain” into 0

update core_config_data
set value="0" 
WHERE path = "web/cookie/cookie_domain"

Once run query all path = “web/cookie/cookie_domain” values will be converted into 0, check again by using select query

select * from core_config_data 
WHERE path = "web/cookie/cookie_domain"
Note: Here only one cookie domain value, if some cases multi store, there
are multiple path = "web/cookie/cookie_domain" & each path value having domain name exists, so you need to converts all 
path = "web/cookie/cookie_domain" values into 0

Finally, localhost Magento 2 admin issue has been resolved.

Leave a Reply

Your email address will not be published. Required fields are marked *