Difficulty importing database

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Difficulty importing database

Postby Cmoorhouse » 19. December 2011 16:55

Firstly to say i am completely new to this.

I have offered to help a friend tweak their website (built by a web developer and use wordpress)

I decided my first step was to create a local version of the site so that i could safely tweak their site offline ie practice

I have followed a step by step guide to do this and have installed xampp 1.7.7. I have used firezilla to copy my wp-contents folders and copied this in xampp/htdocs/mywordpress folder.

I have backup the original live database and altered the website references to localhost/mywordpress.

I believe i am now at the stage of importing this database. Logging into xampp and then phpMyadmin, i navigate to mywordpress and select import and am trying to import the database file into mywordpress. I receive the following error:

#1050 - Table 'wp_commentmeta' already exists

As i said i have extremely new to this so any detailed step by step notes would be hugely appreciated, and please do tell me if i need to start again and again if so, what steps i need to follow

thank you
Cmoorhouse
 
Posts: 9
Joined: 19. December 2011 16:41
Operating System: Windows XP

Re: Difficulty importing database

Postby Sharley » 19. December 2011 17:25

Use the newer xampp-control-3-beta.exe control panel found in the xampp folder.
(The latest version download is linked in my signature)

Then you can then use the XAMPP-Shell button referred to in this post:
viewtopic.php?p=186527#p186527

It may help you get passed this already exists blockage. :)

Good luck. :)
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: Difficulty importing database

Postby Cmoorhouse » 21. December 2011 16:46

thank you - i have just downloaded version the 3.0.11 however I am receiving the following errors:


15:43:55 [apache] Possible problem detected: Apache Not Found!
15:43:55 [apache] Run this program from your XAMPP root directory!
15:43:55 [mysql] Possible problem detected: MySQL Not Found!
15:43:55 [mysql] Run this program from your XAMPP root directory!
15:43:55 [filezilla] Possible problem detected: FileZilla Not Found!
15:43:55 [filezilla] Run this program from your XAMPP root directory!
15:43:55 [mercury] Possible problem detected: Mercury Not Found!
15:43:55 [mercury] Run this program from your XAMPP root directory!
15:43:55 [tomcat] Possible problem detected: Tomcat Not Found!
15:43:55 [tomcat] Run this program from your XAMPP root directory!

What and how do I correct?

thank you
Caroline
Cmoorhouse
 
Posts: 9
Joined: 19. December 2011 16:41
Operating System: Windows XP

Re: Difficulty importing database

Postby Sharley » 21. December 2011 22:15

Cmoorhouse wrote:i have just downloaded version the 3.0.11 however I am receiving the following errors:
Caroline, you need to extract (drag and drop for example) the files from the zip archive into the xampp installation folder (C:\xampp by default), overwrite when asked then double click on the exe file from that location.

You can also right click on the exe file in the xampp folder then select to create a shortcut that you can drag to your desktop or some other handy location.
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: Difficulty importing database

Postby Cmoorhouse » 22. December 2011 16:32

I have successfully got xampp running with the control panel 3.0.11, thank you

I am now attempting to use the xampp shell button to import the sql database. I have copied the database in the folder c:\xampp. I have selected xampp shell on the control panel and a dos window opens and i have entered the file path, mysql -u root -p < dandb.sql --force

I am now being asked for a password? Sorry for all the questions
Cmoorhouse
 
Posts: 9
Joined: 19. December 2011 16:41
Operating System: Windows XP

Re: Difficulty importing database

Postby Sharley » 22. December 2011 16:44

Did you set a password for user root in the XAMPP Welcome page>Security?

If so then you would type that in when asked.

If not then just hit return or just type
Code: Select all
mysql -u root < dandb.sql --force
See how that goes.

It's no problem Caroline asking questions as that is how you learn and is what we are here for. :)
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: Difficulty importing database

Postby Cmoorhouse » 23. December 2011 11:48

Password now sorted, thank you. But i now receive a string of error codes 1046 against various lines

Error 1046 <3D000> at line....: No database selected


Any ideas?
Cmoorhouse
 
Posts: 9
Joined: 19. December 2011 16:41
Operating System: Windows XP

Re: Difficulty importing database

Postby Sharley » 23. December 2011 12:04

Did you follow all the instruction to completion in the link above in my previous post?
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: Difficulty importing database

Postby Cmoorhouse » 23. December 2011 14:54

I have copied my dandb.sql file into the xampp installation folder. ie C:\xampp\dand.sql

and made sure MySQL is running

Is this what you mean?
Cmoorhouse
 
Posts: 9
Joined: 19. December 2011 16:41
Operating System: Windows XP

Re: Difficulty importing database

Postby Sharley » 23. December 2011 22:55

Caroline that was only part of the exercise the rest of the instructions may help if you complete them:
viewtopic.php?p=186527#p186527
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: Difficulty importing database

Postby Cmoorhouse » 27. December 2011 15:17

Hi

A belated happy Christmas

Right back to it:

I have followed the steps in your posting viewtopic.php?p=186527#p186527 (date 11. October 2011 04:00)

1) I have copied my dandb.sql file into the xampp installation folder. ie C:\xampp\dand.sql

2) MySQL is running

3) In the xampp shell, i typed mysql -u root -p < dandb.sql --force


as mentioned previously i receive the string of error codes 1046 against various lines

Error 1046 <3D000> at line....: No database selected
etc....


4)You then say to check the data folder and you should see your databases - can you confirm how i check this ? i cannot obviously see it

5) In the xampp shell I then type mysql_upgrade.exe --force

6) I now restart MySQL

7) On opening phpMyAdmin you say i should see my database - i do not believe it is there - where should i see this ?



8) finally i typed into my browser localhost/mywordpress to see if my site appears - i just get a blank screen


All help gratefully received
Cmoorhouse
 
Posts: 9
Joined: 19. December 2011 16:41
Operating System: Windows XP

Re: Difficulty importing database

Postby Sharley » 27. December 2011 23:00

Hello Caroline,

1. Lets go back to your first post where your error when trying to import the database backup dandb.sql file was
Code: Select all
#1050 - Table 'wp_commentmeta' already exists
Did you already create the WP database after following the WP installation instructions?

What name did you give to the database that you created for WP (dbname) when you created it using phpMyAdmin?

In phpMyAdmin try dropping (deleting) all the tables from that database before trying to import your backup database dandb.sql file.


2. Also In this line I failed to mention that you need to add the existing WP database name (dbname) you are trying to import the sql file into
mysql -u root -p dbname < dandb.sql --force
Which is the reason for these error messages
Code: Select all
Error 1046 <3D000> at line....: No database selected
The page that contained the above instruction was for another issue that was not the same as your issue.


If either of the above 2 possible solutions still don't have you moving forward then there is still another one left but would require you paste here in between forum code tags the first section of your dandb.sql file, which you can read/edit by dragging it into an open text/code editor.


BTW in the mysql\data folder databases are contained in folders with the same name as the database that you can see in phpMyAdmin in the left menu frame.

Good luck. :)
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: Difficulty importing database

Postby Cmoorhouse » 02. January 2012 15:51

Hi

I have worked through the 2 options above - option 2 worked - thank you

Some of the images from my original website have not loaded and some of the text is showing with funny characters but that aside, I am, fingers crossed, ready to play

thank you so much

For info re your option 1

Option 1:
- I had already created the new wordpress database named MyWordpress. Within phpMyAdmin i have now dropped (deleted) the existing tables
- I have now tried again to import my dandb.sql database
I receive the following error message

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '- phpMyAdmin SQL Dump
-- version 2.8.2.4
-- http://www.phpmyadmin.net
--
-- Hos' at line 1

If I proceed with this option how do i check this/correct it?

thank you so much for all your help. Especially over the holiday period
Cmoorhouse
 
Posts: 9
Joined: 19. December 2011 16:41
Operating System: Windows XP

Re: Difficulty importing database

Postby Sharley » 02. January 2012 19:44

Hello Caroline,
I hope you had a lovely holiday.

If you followed option 2 then you may need to update the database for this version of MySQL in 1.7.7

Type in the shell console window (with MySQL running)
Code: Select all
mysql_upgrade.exe --force
to finish option 2.
Then restart MySQL and check if all is now working in WP.

No need to bother with option 1 if we can finally have option 2 working correctly.
The backup database was created with an older version of MySQL and so may need this option 2 upgrade stage to correct any syntax issues that appear to be present.

Good luck and fingers crossed. :)
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 69 guests