How can I import a database with MySQL from terminal?

后端 未结 18 1346
盖世英雄少女心
盖世英雄少女心 2020-11-27 09:14

How can I import a database with mysql from terminal?

I cannot find the exact syntax.

18条回答
  •  死守一世寂寞
    2020-11-27 09:38

    There has to be no space between -p and password

    mysql -u [dbusername] -p[dbpassword] [databasename] < /home/serverusername/public_html/restore_db/database_file.sql
    

    I always use it, it works perfectly. Thanks to ask this question. Have a great day. Njoy :)

提交回复
热议问题