首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用wamp将sql文件导入数据库

问使用wamp将sql文件导入数据库
EN

Stack Overflow用户
提问于 2014-10-11 10:28:26
回答 2查看 50.9K关注 0票数 14

我尝试通过wampserver将我的yyy.sql文件(一个大文件)导入xxx数据库。我将yyy.sql文件复制到C:盘,并通过mysql控制台mysql>使用xxx mysql>source C:\yyy.sql

当我执行这些命令时,它似乎在读取每一行。之后,它给出mysql>,当我检查xxx数据库时,它显示为空。怎么了?

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2014-10-11 10:34:00

选项1; PHPMyAdmin

代码语言:javascript
复制
1. left click wamp -> phpmyadmin
2. select database then click import (top right)
3. locate the database and click go.

选项2;使用命令行执行。

在WAMP中,使用命令行将sql文件导入数据库的最简单方法如下:

代码语言:javascript
复制
1. Open Command Prompt (CMD - DOS) get into the mysql folder, which in my case works like this
C:\> cd C:\wamp\bin\mysql\mysql5.0.51b\bin

2. Then use this command to fire up MySQL
   This line basically connects you to the mysql database of your choice.
   (-p for password if you have one)
C:\wamp\bin\mysql\mysql5.0.51b\bin> mysql.exe -use databasename -u username -p

3. To make things easier, copy the SQL file into the same folder as mysql.exe, and then run this
mysql> source myfilename.sql;
票数 35
EN

Stack Overflow用户

发布于 2015-07-24 16:29:26

  1. 在记事本中打开filename.sql .....
  2. 复制所有内容.....left
  3. 单击wamp>phpmyadmin.....SQL Database.....
  4. and单击

选项卡并粘贴内容.....

  1. 然后单击GO.....万岁!

您已经完成了

票数 -1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/26310424

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档