Need help importing single database.

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

Need help importing single database.

Postby icor1031 » 26. February 2012 12:54

I have an .sql file with all of my old databases. However, some of those databases conflict with current ones.

How do I import a single database out of this .sql file?

i.e., I DO want phpbb database. I DO NOT want wordpress database.

Thanks.
icor1031
 
Posts: 14
Joined: 08. January 2012 10:25
Operating System: w7 hp 64

Re: Need help importing single database.

Postby hackattack142 » 26. February 2012 16:27

XAMPP Control Panel Developer
Latest CP: viewtopic.php?f=16&t=48932
hackattack142
 
Posts: 703
Joined: 20. May 2011 23:29
Operating System: Windows 7 Ultimate SP1 64-Bit

Re: Need help importing single database.

Postby icor1031 » 26. February 2012 23:54

Great, mate.

But, where do I type this? I don't know of an SQL command prompt in xampp.
icor1031
 
Posts: 14
Joined: 08. January 2012 10:25
Operating System: w7 hp 64

Re: Need help importing single database.

Postby hackattack142 » 27. February 2012 02:53

That would be typed at the Windows command prompt (Start > Run > cmd). The mysql it is talking about is in /xampp/mysql/bin
XAMPP Control Panel Developer
Latest CP: viewtopic.php?f=16&t=48932
hackattack142
 
Posts: 703
Joined: 20. May 2011 23:29
Operating System: Windows 7 Ultimate SP1 64-Bit

Re: Need help importing single database.

Postby icor1031 » 27. February 2012 04:55

Thanks, mate.

Not having much luck. Any ideas?
And, I did put sql.sql in the bin folder.

Image
icor1031
 
Posts: 14
Joined: 08. January 2012 10:25
Operating System: w7 hp 64

Re: Need help importing single database.

Postby hackattack142 » 27. February 2012 14:50

You should not split up the steps, it should all be done in one run or you are no longer giving it command line options. For example:

Code: Select all
C:\xampp\mysql\bin>mysql -u root -D name -o < sql.sql
XAMPP Control Panel Developer
Latest CP: viewtopic.php?f=16&t=48932
hackattack142
 
Posts: 703
Joined: 20. May 2011 23:29
Operating System: Windows 7 Ultimate SP1 64-Bit

Re: Need help importing single database.

Postby icor1031 » 28. February 2012 01:16

That fixed this problem, mate. I'm sorry to bug you again, but now I have a new issue.

I placed the sql.sql file into all folders: xampp, mysql, and bin. Just to make sure it wasn't looking in the wrong place.

I get this error, now. :o

Image
icor1031
 
Posts: 14
Joined: 08. January 2012 10:25
Operating System: w7 hp 64

Re: Need help importing single database.

Postby Altrea » 28. February 2012 02:19

Does the database phpbb3 exist?
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 8286
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64

Re: Need help importing single database.

Postby icor1031 » 28. February 2012 02:27

Yeah, I highlighted it in the above image.

Altrea wrote:Does the database phpbb3 exist?
icor1031
 
Posts: 14
Joined: 08. January 2012 10:25
Operating System: w7 hp 64

Re: Need help importing single database.

Postby hackattack142 » 28. February 2012 04:40

Is this a data only dump or does it include the db/table structures and the data?

You could try something like this as well:
Code: Select all
C:\xampp\mysql\bin>mysql -u root
mysql> CREATE DATABASE phpbb3;
mysql> exit
C:\xampp\mysql\bin>mysql -u root -D phpbb3 -o < sql.sql
XAMPP Control Panel Developer
Latest CP: viewtopic.php?f=16&t=48932
hackattack142
 
Posts: 703
Joined: 20. May 2011 23:29
Operating System: Windows 7 Ultimate SP1 64-Bit

Re: Need help importing single database.

Postby icor1031 » 28. February 2012 05:46

Thanks, buddy!

hackattack142 wrote:Is this a data only dump or does it include the db/table structures and the data?

You could try something like this as well:
Code: Select all
C:\xampp\mysql\bin>mysql -u root
mysql> CREATE DATABASE phpbb3;
mysql> exit
C:\xampp\mysql\bin>mysql -u root -D phpbb3 -o < sql.sql
icor1031
 
Posts: 14
Joined: 08. January 2012 10:25
Operating System: w7 hp 64


Return to XAMPP for Windows

Who is online

Users browsing this forum: Altrea and 52 guests