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

后端 未结 7 1147
-上瘾入骨i
-上瘾入骨i 2021-02-05 01:34

is this right?

mysql -uroot -ppassword mydb < myfile.sql.gz
相关标签:
7条回答
  • 2021-02-05 02:39

    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

    0 讨论(0)
提交回复
热议问题