我尝试通过 wampserver 将我的 yyy.sql 文件(一个大文件)导入到 xxx 数据库中。我将 yyy.sql 文件复制到 C: 驱动器并通过 mysql 控制台 mysql> 使用 xxx mysql>源C:\yyy.sql
当我执行这些命令时,它似乎在读取每一行。 之后它给出 数据库> 当我检查 xxx 数据库时,它显示为空。 怎么了?
最佳答案
选项 1;PHPMyAdmin
1. left click wamp -> phpmyadmin
2. select database then click import (top right)
3. locate the database and click go.
选项 2;使用命令行。
在 WAMP 中将 sql 文件导入数据库的最简单方法,使用命令行如下:
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;
关于mysql - 使用wamp将sql文件导入数据库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26310424/