mysql data transfer

  You are currently not logged in. You can view the forums, but cannot post messages. Log In | Register

04-Dec-11 10:12
I downloaded a dump from my host site and the file looks like a source file with all the commands for setting up the database and all the data. however when I try to run it in Mysql to put it on my localhost I get this: mysql> source /home/downloads/rustic.sql;
ERROR:
Failed to open file '/home/downloads/rustic.sql', error: 2
Someone on another site suggested I drop the ; terminator but it didn't matter. I've tried various combinations to my home/download/file.sql and none work. I'm using Ubuntu 11.10 as localhost.
Any suggestions please?
Thanks

--
Jack
05-Dec-11 06:31
I think I got the path right this time, also spelled my filename right. /home/jacknet/Downloads/rusticdb.sql and I changed permissions to rwx for owner and user and ran:
mysql> source /home/jacknet/Downloads/rusticdb.sql; and got
ERROR 1046 (3D000): No database selected
ERROR 1046 (3D000): No database selected
ERROR 1046 (3D000): No database selected
ERROR 1046 (3D000): No database selected
The first line in the script file is "Create database 'xxxxxxxxx'"
So I'm still not sure it ran the .sql file or if it did why didn't it find a database when the first line says to create one?

--
Jack
06-Dec-11 20:52
@jacknet: You need to run "use databaseName" after you've created a database and before you start using it.

http://dev.mysql.com/doc/refman/5.0/en/use.html

--
Matt Doyle, Elated
3rd Edition of my jQuery Mobile book out now! Learn to build mobile web apps. Free sample chapter: http://store.elated.com/

 
New posts
Old posts

Follow Elated