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

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

问题描述

我想将SQL文件(大小> 500MB)导入数据库.我在电脑上擦了擦. 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:\Nisarg\ISPC\Database\sysdat.sql 
mysql -u root -p -D sysdat < D:\Nisarg\ISPC\Database\sysdat.sql
mysql -u root sysdat < D:\Nisarg\ISPC\Database\sysdat.sql -p 

这些都不起作用.

推荐答案

尝试如下:

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

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

C:\xampp\mysql\bin\mysql -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天全站免登陆