MySQL 导入数据库架构

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/26015521/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 13:04:58  来源:igfitidea点击:

MySQL Import Database Schema

mysqlcommand-linemysqldump

提问by Richard Skinner

I'm having issues attempting to import a database of 195MB via the command line.

我在尝试通过命令行导入 195MB 的数据库时遇到问题。

mysql -u root -p [DB_NAME] C:\Users\user_name\Downloads\file.sql

When I run this command all I receive from MySQL is a list of variables and options available.

当我运行这个命令时,我从 MySQL 收到的只是一个可用的变量和选项列表。

What am I doing wrong?

我究竟做错了什么?

Also like to add I'm using a fresh install of XAMPP.

还想补充一点,我正在使用全新安装的 XAMPP。

回答by fancyPants

You're missing a <, which means you want to direct the content of the file into mysql.

你缺少一个<,这意味着你想将文件的内容定向到 mysql。

mysql -u root -p [DB_NAME] < C:\Users\user_name\Downloads\file.sql