Tuesday, March 27, 2012

Importing a large SQL file to mysql db

In command prompt
go to mysql bin folder

cd xampp\htdocs\mysql\bin


mysql -u username -p password database_name < filepath/filename.sql




Sometimes i get the following error.



ERROR 2006 (HY000): MySQL server has gone away
then open my.ini  file (C:\xampp\mysql\bin or where you install mysql)

change max_allowed_pocket in [mysqldump]

max_allowed_packet = 512M   #(or what you want)