How can I import a database with MySQL from terminal?

后端 未结 18 1339
盖世英雄少女心
盖世英雄少女心 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:16

    Explanation:

    1. First create a database or use an existing database. In my case, I am using an existing database

    2. Load the database by giving = ClassicModels in my case and using the operator < give the path to the database = sakila-data.sql

    3. By running show tables, I get the list of tables as you can see.

    Note : In my case I got an error 1062, because I am trying to load the same thing again.

提交回复
热议问题