dbTalk Databases Forums  

Problem importing a database

comp.databases.mysql comp.databases.mysql


Discuss Problem importing a database in the comp.databases.mysql forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Martin
 
Posts: n/a

Default Problem importing a database - 04-20-2011 , 02:02 PM






I have Exported a database from a MySQL installation (creating the
DatabaseName-20808-1303309022.sql file).

On another computer (with a new installation of MySQL) when I try to
import this file (using MySQL Workbench) the process aborts with
error: "No database selected".

If it matters, the export is being done from my website using the
"MySQL Tools" provided by the host: ICDSoft

The setup I'm trying to import to is a personal computer running
Windows XPPro with all service packs and updates. The
MySQL installation is ver 5.5.11.7 (a new installation).

I've spent a couple of hours Googling around trying find out how to
get past this but have had no luck.

Help?

Reply With Quote
  #2  
Old   
dewed
 
Posts: n/a

Default Re: Problem importing a database - 04-20-2011 , 05:24 PM






try adding a single line to the top of your file and then import it

USE DATABASENAME;


If the user has permissions to the specified database it should process with the import

Reply With Quote
  #3  
Old   
Martin
 
Posts: n/a

Default Re: Problem importing a database - 04-20-2011 , 08:35 PM



On Wed, 20 Apr 2011 15:24:06 -0700 (PDT), dewed
<duane.lortie (AT) gmail (DOT) com> wrote:

Quote:
try adding a single line to the top of your file and then import it

USE DATABASENAME;


If the user has permissions to the specified database it should process with the import
Thanks.

I just now tried it - didn't work. This time I get error 1049 "Unknown
database 'cwdb' ". "cwdb" is, of course, the name I specified in the
USE statement.

Do I need to create this database before I run the import? I thought
that the action of importing would create it. And, if I am supposed to
create the database before running the script, how do I go about doing
that. I don't see anything in MySQLWorkbench that would enable me to
do that.

Reply With Quote
  #4  
Old   
Martin
 
Posts: n/a

Default Re: Problem importing a database - 04-20-2011 , 09:06 PM



On Wed, 20 Apr 2011 18:35:58 -0700, Martin <ironwoodcanyon (AT) gmail (DOT) com>
wrote:

Quote:
On Wed, 20 Apr 2011 15:24:06 -0700 (PDT), dewed
duane.lortie (AT) gmail (DOT) com> wrote:

try adding a single line to the top of your file and then import it

USE DATABASENAME;


If the user has permissions to the specified database it should process with the import

Thanks.

I just now tried it - didn't work. This time I get error 1049 "Unknown
database 'cwdb' ". "cwdb" is, of course, the name I specified in the
USE statement.

Do I need to create this database before I run the import? I thought
that the action of importing would create it. And, if I am supposed to
create the database before running the script, how do I go about doing
that. I don't see anything in MySQLWorkbench that would enable me to
do that.

NEVERMIND...... I got it working!

I finally figured out how to create a database (or schema as they call
it). After doing that and then using the USE statement as you
suggested, the import worked.

Now I can get on with things.

Thanks again.

Reply With Quote
  #5  
Old   
Álvaro G. Vicario
 
Posts: n/a

Default Re: Problem importing a database - 04-25-2011 , 02:36 AM



El 20/04/2011 21:02, Martin escribió/wrote:
Quote:
I have Exported a database from a MySQL installation (creating the
DatabaseName-20808-1303309022.sql file).

On another computer (with a new installation of MySQL) when I try to
import this file (using MySQL Workbench) the process aborts with
error: "No database selected".
Run this query:

USE databasename;

.... where databasename is the name of the database where you want to
insert stuff.





--
-- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web: http://borrame.com
-- Mi web de humor satinado: http://www.demogracia.com
--

Reply With Quote
  #6  
Old   
Álvaro G. Vicario
 
Posts: n/a

Default Re: Problem importing a database - 04-25-2011 , 02:38 AM



El 21/04/2011 0:24, dewed escribió/wrote:
Quote:
try adding a single line to the top of your file and then import it

USE DATABASENAME;


If the user has permissions to the specified database it should process with the import
I've just written the same exact answer because the question did not
have any answers. Please, next time try to link your answer to the
original question rather than opening a new thread.


--
-- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web: http://borrame.com
-- Mi web de humor satinado: http://www.demogracia.com
--

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.