Tips & Tricks

Magento admin login problem after fresh installation

Recently I have started learning Magento. It’s just amazing. I have faced one interesting problem today with Magento.


The problem is, I have just installed magento on my machine, after installation front end work fine, but I can not login to the magento admin panel even with correct username and password. It not even given error for this but redirecting to the same page. And if I enter wrong username and password it will give Wrong username / password error. It seems like that you have proper credential but magento just not allowing you to let into the admin panel.

I was wondered that magento is a very big community and it’s a very fast growing shopping cart open source code, it must not have this type of bug.


There are several solutions for these, but I will post here which is most works for most of developers.

1)  replacing localhost with

If you have installed you magento on localhost and trying to access like http://localhost/magento .

But due to standard restriction browser don’t save cookies for domains with no dots in domain name. So I suggest you to access your magento using, this will work. This works even for me.

For this solution, if you have installed your magento using localhost, then you have to make some alteration in database tables.

You have to replace localhost with in core_config_data table.

User below query to find the rows which have localhost entered:

[cc lang=”php”]Select * from core_config_data where value LIKE ”%localhost%”[/cc]

You will get two rows, you just have to update these two rows from localhost to

You can use below query to update these two rows:

[cc lang=”php”]UPDATE core_config_data SET value = WHERE path IN (‘web/unsecure/base_url’,’ web/secure/base_url’);[/cc]

I hope you will place proper values in above queries suitable for you.

2)  Editing the virtual host file

If you are on windows machine then you can change you host file to locate localhost to some other domain which have at least single dot (.) in it.

You can find the this file at below path:

[cc lang=”php”]C:\WINDOWS\system32\drivers\etc[/cc]

In this folder there must one file called hosts, in this file you can point localhost or to some domain like

Hope this post will helpful for you, waiting for your responses.


Leave a Reply

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