在 Windows 7 中通过命令行导入 SQL 文件 [英] Import SQL file by command line in Windows 7

查看:36
本文介绍了在 Windows 7 中通过命令行导入 SQL 文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将一个 SQL 文件(大小 > 500MB)导入到数据库中.我的电脑上有 wamp.phpmyadmin 不能很好地处理这种大小.我更改了 php.ini 中的所有参数(max_upload_size 等).但它对我不起作用.所以我想通过命令行导入它.

I want to import an SQL file (size > 500MB) into a database. I have wamp on my PC. Phpmyadmin does not work well with this size. I changed all parameters in php.ini (max_upload_size etc.). But it does not work for me. So I want to import it by command line.

我使用这些命令导入文件:

I used these commands for import the file:

mysql -u root -p sysdat < D:NisargISPCDatabasesysdat.sql 
mysql -u root -p -D sysdat < D:NisargISPCDatabasesysdat.sql
mysql -u root sysdat < D:NisargISPCDatabasesysdat.sql -p 

这些都不起作用.

推荐答案

试试这个:

我认为您需要在命令行中使用完整路径,例如:

I think you need to use the full path at the command line, something like this, perhaps:

C:xamppmysqlinmysql -u {username} -p {databasename} < file_name.sql

另请参阅此链接:

http://www.ryantetek.com/2011/09/importing-large-sql-files-through-command-line-when-using-phpmyadminxampp/

这篇关于在 Windows 7 中通过命令行导入 SQL 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆