Import sql file to database using wamp

I tried to import my yyy.sql file (large file) into the xxx database via wampserver. I copied the yyy.sql file to the C: drive and through the mysql console mysql> use xxx mysql> source C: \ yyy.sql

when I execute these commands it seems to read every line. after that it gives MySQL> and when I check the xxx database, it shows empty. what's wrong?

+5
source share
2 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 the 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; 
+17
source
  • OPEN file filename.sql in NOTEPAD .....

  • COPY all content ..... left

  • Click wamp> phpmyadmin .....

  • CREATE A NEW DATABASE .....
  • and go to the SQL tab and paste the contents into it .....
  • then press GO ... Hooray!

    you did

0
source

Source: https://habr.com/ru/post/1204462/


All Articles