Page 1 of 1

Need help importing single database.

PostPosted: 26. February 2012 12:54
by icor1031
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.

Re: Need help importing single database.

PostPosted: 26. February 2012 16:27
by hackattack142

Re: Need help importing single database.

PostPosted: 26. February 2012 23:54
by icor1031
Great, mate.

But, where do I type this? I don't know of an SQL command prompt in xampp.

Re: Need help importing single database.

PostPosted: 27. February 2012 02:53
by hackattack142
That would be typed at the Windows command prompt (Start > Run > cmd). The mysql it is talking about is in /xampp/mysql/bin

Re: Need help importing single database.

PostPosted: 27. February 2012 04:55
by icor1031
Thanks, mate.

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

Image

Re: Need help importing single database.

PostPosted: 27. February 2012 14:50
by hackattack142
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

Re: Need help importing single database.

PostPosted: 28. February 2012 01:16
by icor1031
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

Re: Need help importing single database.

PostPosted: 28. February 2012 02:19
by Altrea
Does the database phpbb3 exist?

Re: Need help importing single database.

PostPosted: 28. February 2012 02:27
by icor1031
Yeah, I highlighted it in the above image.

Altrea wrote:Does the database phpbb3 exist?

Re: Need help importing single database.

PostPosted: 28. February 2012 04:40
by hackattack142
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

Re: Need help importing single database.

PostPosted: 28. February 2012 05:46
by icor1031
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