How can I import a database with MySQL from terminal?

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

    1. Open the MySQL Command Line Client and type in your password

    2. Change to the database you want to use for importing the .sql file data into. Do this by typing:

      USE your_database_name
      
    3. Now locate the .sql file you want to execute.
      If the file is located in the main local C: drive directory and the .sql script file name is currentSqlTable.sql, you would type the following:

      \. C:\currentSqlTable.sql
      

      and press Enter to execute the SQL script file.

提交回复
热议问题