Could you list the steps you’re doing to install Magento with the sample data? Here’s how I do it:
1. Download and extra the Magento and sample data files.
2. Set the appropriate permissions.
3. Import the SQL file into a clean database.
4. Run the PEAR updater.
5. Go to the web-based installer.
Or, an easier way if you have SSH, is to do this:
wget http://www.magentocommerce.com/downloads/assets/1.0.19870/magento-1.0.19870.4.tar.gz
wget http://www.magentocommerce.com/downloads/assets/1.0.19870/magento-sample-data-1.0.19870.tar.gz
tar -zxvf magento-1.0.19870.4.tar.gz
tar -zxvf magento-sample-data-1.0.19870.tar.gz
mv magento-sample-data-1.0.19870/media/* magento/media/
mv magento-sample-data-1.0.19870/magento_sample_data_for_1.0.19870.sql magento/data.sql
cd magento
chmod o+w var var/.htaccess app/etc
chmod -R o+w media
mysql -u DBUSER -pDBPASSDBNAME < data.sql
./pear mage-setup .
./pear install -f magento-core/Mage_All_Latest
rm -rf downloader/pearlib/cache/* downloader/pearlib/download/* .htaccess.sample data.sql index.php.sample ../magento-1.0.19870.4.tar.gz ../magento-sample-data-1.0.19870/ ../magento-sample-data-1.0.19870.tar.gz
find . -type d -exec chmod 777 {} \;
Replace the underlined DB values of course.
That will install the latest version of Magento in a directory called magento. It will also install the sample data and setup Magento Connect (PEAR downloader) so you can use that later to upgrade or get extensions.
1) Download Magento 1.0.19870 and the coinciding Sample Data for 1.0.19870.
2) Create clean db for Magento installtion
3a) Upload files
3b) Try to run the sample-data.sql file (or whatever it’s called) via phpMyAdmin and I get that error.
As far as your method: I’ll try to work with my host to allow for me to have enough access via SSH to do all that. I don’t want to install the store in a directory called Magento though. I’d like to have it in the root of wherever I am hosting it. No biggie, right?
Also, would the failure to have all the files uploaded and permissions changed actually cause the SQL import to fail like it is?
I compared it with the sample data from the latest release, and it’s different by a few bytes. What exactly, I’m not sure, I didn’t open them up to examine. Most likely code that drops constraints or something.
OMG thank you so much for this! you have no idea how many times i kept dropping all my tables and rerunning the SQL, thinking that i imported wrong somehow.
Installation Error
Demo site home page displays - Clicking on any product produces an error using the front end.
Using version 1.1.2 on a localhost WampServer with sample data pack 1.0.19870.zip as posted in the download section. Imported data from sample pack into a magento DB produced no errors using PHPMyAdmin. Media files added as per instructions for sample images.
The following message is displayed when clicking on the home page under ‘best selling products’ and then ‘Sony VAIO’ image.
When looking at the Megento files, there is no apparel or shoes or womens file folder. These were not included in the ‘media’ files provided as part of the sample data 1.1.3 file. Are these missing? Or is the path not correct and they can not be located.
SOLUTION for error #1005 on importing magento_sample_data_for_1.1.2.sql
MySQL 5.0.58
phpMyAdmin 2.8.2.4
This is a solution for the error: #1005 - Can’t create table ‘./db_magento/catalog_category_entity_datetime.frm’ (errno: 150).
After research it seemed that the SET FOREIGN_KEYS_CHECKS=0 command was ignored.
This command is in the inline comments part of the sql file (top of the script):
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
The /* is the comment character and the ! tells mysql to execute the code within the comment. The number 40014 is a version number.
For some reason the code is not executed due to the inline comment.
Removing the version number did not solve it.
WORKING SOLUTION:
Remove the inline comment or replace line with:
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SQL file will import successfully.
UPDATE:
Apart from solution above:
I also noticed that some tables are MyISAM, change everything to InnoDB
UPDATE2:
REMOVE ALL INLINE COMMENTS, PRESERVE THE CODE WITHIN THE COMMENTS
for some reason ALL code in inline comments is not executed causing an install failure of the shop