Import SQL file into mysql(将SQL文件导入mysql)
问题描述
我有一个名为 nitm 的数据库.我没有在那里创建任何表.但是我有一个 SQL 文件,其中包含数据库的所有必要数据.该文件是 nitm.sql,它在 C:\drive 中.该文件的大小约为 103 MB.我正在使用 wamp 服务器.
I have a database called nitm. I haven't created any tables there. But I have a 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 103 MB. 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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:将SQL文件导入mysql
基础教程推荐
- ORA-01830:日期格式图片在转换整个输入字符串之前结束/选择日期查询的总和 2021-01-01
- 带有WHERE子句的LAG()函数 2022-01-01
- CHECKSUM 和 CHECKSUM_AGG:算法是什么? 2021-01-01
- 使用 VBS 和注册表来确定安装了哪个版本和 32 位 2021-01-01
- 带更新的 sqlite CTE 2022-01-01
- MySQL 5.7参照时间戳生成日期列 2022-01-01
- MySQL根据从其他列分组的值,对两列之间的值进行求和 2022-01-01
- 从字符串 TSQL 中获取数字 2021-01-01
- while 在触发器内循环以遍历 sql 中表的所有列 2022-01-01
- 如何在 CakePHP 3 中实现 INSERT ON DUPLICATE KEY UPDATE aka upsert? 2021-01-01
