WildCatzPhreak Posted May 10, 2008 Share Posted May 10, 2008 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. Quote Link to comment Share on other sites More sharing options...
mezise Posted May 10, 2008 Share Posted May 10, 2008 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; Quote Link to comment Share on other sites More sharing options...
WildCatzPhreak Posted May 10, 2008 Author Share Posted May 10, 2008 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. Quote Link to comment Share on other sites More sharing options...
WildCatzPhreak Posted May 10, 2008 Author Share Posted May 10, 2008 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? Quote Link to comment Share on other sites More sharing options...
mezise Posted May 10, 2008 Share Posted May 10, 2008 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; Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.