Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I load a sql.gz file to my database? (importing)

Tags:

database

mysql

is this right?

mysql -uroot -ppassword mydb < myfile.sql.gz 
like image 685
TIMEX Avatar asked May 03 '10 07:05

TIMEX


1 Answers

No, it isn't. The right way would be

zcat myfile.sql.gz | mysql -u root -ppassword mydb 

Note there can be no space between the -p and password if using the -p syntax, refer http://dev.mysql.com/doc/refman/5.5/en/mysql-command-options.html#option_mysql_password

like image 67
Artyom Avatar answered Oct 07 '22 12:10

Artyom