将SQL文件导入mysql [英] Import SQL file into mysql

查看:339
本文介绍了将SQL文件导入mysql的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个数据库`nitm`。我没有创建任何表。但我有一个sql文件,其中包含数据库的所有必要的数据。文件是`nitm.sql`,它在`C:\ drive`中。此文件的大小约为103M。我使用wamp服务器。

I have a database `nitm`. I haven't created any tables there. But I have an sql file which contains all the necessary data for the database. The file is `nitm.sql` which is in `C:\ drive`. This file has size of about 103M. I am using wamp server.

我在mysql控制台中使用以下语法导入文件。

I have used the following syntax in mysql console to import the file.

mysql>c:/nitm.sql;

但这不起作用。

推荐答案

最后,我解决了问题。我将`nitm.sql`文件放在`mysql`文件夹的`bin`文件中,并使用以下语法。

Finally, i solved the problem. I placed the `nitm.sql` file in `bin` file of the `mysql` folder and used the following syntax.

C:\wamp\bin\mysql\mysql5.0.51b\bin>mysql -u root nitm < nitm.sql

这样有效。

这篇关于将SQL文件导入mysql的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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