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

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

is this right?

mysql -uroot -ppassword mydb < myfile.sql.gz
7条回答
  •  既然无缘
    2021-02-05 02:17

    Straight and clear:

    gunzip -c myfile.sql.gz | mysql -uroot -ppassword mydb

    -c option for gunzip writes to stdout, keeps original files

    NOTE: You shouldn't put the password directly in the command. It's better to provide just -p and than enter the password interactively.

提交回复
热议问题