Cannot log in to Magento after Installing Sample Database

Asked By 0 points N/A Posted on -
qa-featured

Hi,

Have anyone here trying to install Sample Database from Magento. Have you succeeded?

I have a fresh copy of Magento installed. Then I tried to download the sample database provided version 1.2. My Magento version is 1.5+.

I succeeded installing Magento previously, and I was able to log in to the Backend using admin account. But when I load a SQL file contains sample database provided from Magento site.

I was unable to log in to the Backend anymore using admin account. I'm sure that I don't mistype the password.

Any suggestion what's happened?

Thanks.

Invalid Username or Password.

SHARE
Best Answer by DodieWurst
Best Answer
Best Answer
Answered By 0 points N/A #121684

Cannot log in to Magento after Installing Sample Database

qa-featured

Hi,

In this case you need to make perfect relation for PHP page with SQL database. I am giving an example here:

<?php

$hostname="localhost";

$user="root";

$pass="";

mysql_connect($hostname,$user,$pass)or die ("dead 1");

$db="rezu";

mysql_select_db($db)or die ("dead 2");

?>
You need to create a configure page and include it with all PHP pages.
You need to take care about three things. One is relation for PHP page with SQL database and other one is query in SQL database. And last one is condition. You have to give username and password in SQL database perfectly, and also field mane must have to be right.

Answered By 5 points N/A #121685

Cannot log in to Magento after Installing Sample Database

qa-featured

First Solution
In different forums I saw they mentioned connecting as http://localhost/magento/index.php/admin will fail but if you connect as https://stackoverflow.com/questions/15639199/localhost-to-127-0-0-1-as-default it will work. But in my case IP address in the URL did not work too.

I made it work into whenever I changed my browser. Suppose I installed magento using Google chrome browser and I open admin url into my firefox window and it worked. Though in the firefox the url http://localhost/magento/index.php/admin did not work, but url https://stackoverflow.com/questions/15639199/localhost-to-127-0-0-1-as-default worked fine.

Second Solution

Go to app/code/core/Mage/Core/Model/Session/Abstract/Varien.php file within your magento directory.

Find the code:

session_set_cookie_params(
$this->getCookie()->getLifetime(),
$this->getCookie()->getPath(),
$this->getCookie()->getDomain(),
$this->getCookie()->isSecure(),
$this->getCookie()->getHttponly()
);

and replace with

session_set_cookie_params(
$this->getCookie()->getLifetime(),
$this->getCookie()->getPath()
//$this->getCookie()->getDomain(),
//$this->getCookie()->isSecure(),
//$this->getCookie()->getHttponly()
);

After this save the file. And try to login into the admin.

I think it will work now.

Related Questions