问题:
I have a .sql file with an export from phpMyAdmin . 我有一个.sql文件,从phpMyAdmin导出。 I want to import it into a different server using the command line. 我想使用命令行将其导入到其他服务器中。
I have a Windows Server 2008 R2 installation. 我有Windows Server 2008 R2安装。 I placed the .sql file on the C drive , and I tried this command 我将.sql文件放在C驱动器上 ,并尝试了此命令
database_name < file.sql
It is not working. 它不起作用。 I get syntax errors. 我收到语法错误。
- How can I import this file without a problem? 如何顺利导入该文件?
- Do I need to create a database first? 我需要先创建一个数据库吗?
解决方案:
参考一: https://stackoom.com/question/1C7nV/如何在MySQL中使用命令行导入SQL文件参考二: https://oldbug.net/q/1C7nV/How-do-I-import-an-SQL-file-using-the-command-line-in-MySQL
来源:oschina
链接:https://my.oschina.net/stackoom/blog/4469995