importing database.sql
I've uploaded the file to:
/srv/www/mydomain.com/public_html/databaseBU.sql
questions:
1) what is the command I should run once inside mysql/terminal
2) how long should 70mb take to import?
Running Ubuntu Hardy.
Thanks
13 Replies
cat /srv/www/mydomain.com/public_html/databaseBU.sql | mysql
> how long should 70mb take to import?
It depends.
Stop piping cats:
mysql < /srv/www/mydomain.com/public_html/databaseBU.sql
See this link
… we now return you to your regular programming
@hoopycat:
mysql < /srv/www/mydomain.com/public_html/databaseBU.sql
OK, thanks. so i'm at the mysql cursor and this is what i enter:
mysql -u username -p password MyDatabase < /srv/www/mydomain.com/public_html/databaseBU.sql;
you have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '< /srv/www/…
The problem might have to do with the contents of the file, or it might have to do with the syntax you're using. Try this: Don't specify the password on the command line. Just skip the password, and MySQL will ask you for it.
mysql -u username -p MyDatabase < /srv/www/mydomain.com/public_html/databaseBU.sql
The above command would look as if it's supplying "MyDatabase" as the password, but in fact it's not. Crazy MySQL command line
@hybinet:
That new cursor means that you have entered an incomplete SQL command, so MySQL is waiting for you to complete it.
The problem might have to do with the contents of the file, or it might have to do with the syntax you're using. Try this: Don't specify the password on the command line. Just skip the password, and MySQL will ask you for it.
mysql -u username -p MyDatabase < /srv/www/mydomain.com/public_html/databaseBU.sql
The above command would look as if it's supplying "MyDatabase" as the password, but in fact it's not. Crazy MySQL command line
;)
thanks for the reply, now I'm getting an error in my SQL syntax. hmmm… I wonder if something happened when I FTP'd the *.sql file.
mysql -u root -p
Do you successfully log in?
show databases;
Does MyDataBase show up?
If the above works, try cd'ing to the directory your .sql file is in, then run the import command without the path.
mysql -u username -p database_name < FILE.sql
@embarkadero:
OK, thanks. so i'm at the mysql cursor and this is what i enter:
mysql -u username -p password MyDatabase < /srv/www/mydomain.com/public_html/databaseBU.sql;
You should type that at the shell command line not at the mysql command line.
@Xan:
Wait, did you say you're running that command from the mysql prompt? It needs to be run from the shell.
YES! This worked. Thank you to everyone who took the time to respond.
@atourino:
You should type that at the shell command line not at the mysql command line.
Thank the lord!