TIMEX TIMEX - 1 year ago 78
MySQL Question

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

is this right?

mysql -uroot -ppassword mydb < myfile.sql.gz

Answer Source

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download