No of visitors who read this post: 1955
Category: PHP
Type: Question
No votes yet

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.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

# Comment Id: 27397

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.

# Comment Id: 29130

First Solution
In different forums I saw they mentioned connecting as http://localhost/magento/index.php/admin will fail but if you connect as http://127.0.0.1/magento/index.php/admin 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 http://127.0.0.1/magento/index.php/admin 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.