is this right?
mysql -uroot -ppassword mydb < myfile.sql.gz
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
You have to follow below steps:
First check Mysql service should be running.
Then if you have compressed file, decompress it first.