I want to import an SQL file (size > 500MB) into a database. I have wamp on my PC. Phpmyadmin does not work well with this size. I changed all parameters in php.ini (max_upload_
Related to importing, if you are having issues importing a file with bulk inserts and you're getting MYSQL GONE AWAY, lost connection or similar error, open your my.cnf / my.ini and temporarily set your max_allowed_packet to something large like 400M
Remember to set it back again after your import!
TRY THIS
C:\xampp\mysql\bin\mysql -u {username} -p {databasename} < {filepath}
if username=root ,filepath='C:/test.sql', databasename='test' ,password ='' then command will be
C:\xampp\mysql\bin\mysql -u root test < C:/test.sql
If you don't have password you can use the command without
-u
Like this
C:\wamp>bin\mysql\mysql5.7.11\bin\mysql.exe -u {User Name} {Database Name} < C:\File.sql
Or on the SQL console
mysql -u {User Name} -p {Database Name} < C:/File.sql
To import database from dump file use:
mysql -u UserName -p Password DatabaseName < FileName.sql
In wamp
C:\wamp\bin\mysql\mysql5.0.51b\bin>mysql mysql -uroot -p DatabaseName < FileName.sql