Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

importing sql file into a database using wamp

Tags:

mysql

wamp

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 console mysql> use xxx mysql>source C:\yyy.sql

when I execute these commands it seems its reading each row. after that it gives mysql> and when I check the xxx database it's showing empty. what's wrong?

like image 962
Gogo Avatar asked Oct 11 '14 02:10

Gogo


People also ask

How do I connect to a database in WAMP?

Connect to MAMP via a standard TCP/IP connectionEnter 127.0. 0.1 for the Host. Enter root for the username and for the password. The default MySQL port used by MAMP is 8889.

How would you import a large MySQL database .SQL file to phpMyAdmin using WAMP?

Hi, in this short tutorial, I will show you how to import a large database in PHPMyAdmin. After creating the database, you need to open the MySQL command line from wamp service. After opening the command line interface, you will be prompted to enter a password, just press enter in case you don't have a password.


1 Answers

Option 1; PHPMyAdmin

1. left click wamp -> phpmyadmin
2. select database then click import (top right)
3. locate the database and click go.

Option 2; Using the command line.

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;
like image 170
Meer Avatar answered Oct 01 '22 19:10

Meer