本文介绍了使用WAMP将sql文件导入数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我尝试通过wampserver将yyy.sql文件(大文件)导入xxx数据库.我将yyy.sql文件复制到C:驱动器并通过mysql控制台mysql>使用xxxmysql>源C:\ yyy.sql
I tried importing my yyy.sql file ( a large file) into xxx database through wampserver. I copied yyy.sql file to C: drive and through mysql consolemysql> use xxxmysql>source C:\yyy.sql
当我执行这些命令时,它似乎在读取每一行.之后,它给mysql>当我检查xxx数据库时,它显示为空.怎么了?
when I execute these commands it seems its reading each row.after that it givesmysql>and when I check the xxx database it's showing empty.what's wrong?
推荐答案
选项1; PHPMyAdmin
Option 1; PHPMyAdmin
1. left click wamp -> phpmyadmin
2. select database then click import (top right)
3. locate the database and click go.
选项2; 使用命令行.
使用命令行将sql文件导入WAMP中的数据库的最简单方法如下:
The easiest way to import a sql file into a database in WAMP, using command line is as follows:
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;
这篇关于使用WAMP将sql文件导入数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!