Jump to content

Having big problems importing a MySQL database


WildCatzPhreak

Recommended Posts

Here's the story - I exported my database from a webhost via phpmyadmin.  I tried importing on my local machine using phpmyadmin, and it told me the file was too big to upload, and to use the console.  (I unsuccesfully tried tweaking the php.ini file to allow me to upload larger files.)  When I try to upload the database using the mysql console, this is the command I use:

 

source wiki.sql

 

The console starts freaking out on me, continually beeping until it eventually crashes.

 

Error 1046: No database selected

 

I've tried placing the database in every folder I can find that I think may be the source folder, unsuccessfully.  And I'm very unfamiliar with what commands can be used in the mysql console.

 

Anyone have any advice?  I'm completely lost at this point.

Link to comment
Share on other sites

Hi,

 

if wiki.sql file does not have 'USE your_database_name;' as first command, you need to instruct MySQL

about database name to import to.

Execute 2 commands:

USE your_database_name;
source wiki.sql;

 

Thanks for the reply.

 

When I tried the use (dbname); I got an error:

Unknown database

 

source wiki.sql is still diong the same thing. It tells me the query OK, 0 rows affected, and then spams

 

Error 1046: No database selected

Error 1046: No database selected

Error 1046: No database selected

Error 1046: No database selected

Error 1046: No database selected

Error 1046: No database selected

 

over and over again.

Link to comment
Share on other sites

New information:

 

I tried exporting the sql file again from my webhost, this time zipping it.  When I try using the commands suggested to me by mezise, I get a completely different response from the console:

 

Access denied for user 'blah@localhost' to database

 

So I think I'm making progress.  How do I tell mysql what username and password to use to access the database?

Link to comment
Share on other sites

To log in using mysql console type this:

PROMPT> mysql -u YourUsername -p YourDatabaseName
PROMPT> YourPassword
PROMPT> source wiki.sql;

or

PROMPT> mysql -u YourUsername -p
PROMPT> YourPassword
PROMPT> use YourDatabaseName;
PROMPT> source wiki.sql;

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.