bekircem
By:
bekircem

Big size SQL import problem?

March 29, 2015 1.6k views
DigitalOcean Apache MySQL

Hi.

I have backup of Mybb forum SQL. I want to import that. SQL file size is 222MB. I used Bigdump.php. But when proccess is %100, it give me error:

ALTER TABLE `mybb_posts` ADD PRIMARY KEY (`pid`), ADD KEY `tid` (`tid`,`uid`), ADD KEY `uid` (`uid`), ADD KEY `visible` (`visible`), ADD KEY `dateline` (`dateline`), ADD KEY `longipaddress` (`longipaddress`), ADD FULLTEXT KEY `message` (`message`); -> Lost connection to MySQL server during query

I tried many times but import is not completed. How i fix that?

2 comments
  • how big is your SQL file?

    have you uploaded that file onto your server before importing it?

  • PHP has a timeout, and a max-upload-size limit.

    I'd recommend that you do it this way:

    • upload your file to /root/ and name it new_import.sql
    • in BASH/PuTTY, run this (change rootpw, and dbname):
    root_pw='YOUR_PASSWORD_HERE'
    db_name="YOUR_DB_NAME"
    mysql -u root -p${root_pw} -D $db_name < /root/new_import.sql
    

    If you need help with this, let me know.

1 Answer

This question was answered by @JonsJava:

PHP has a timeout, and a max-upload-size limit.

I'd recommend that you do it this way:

  • upload your file to /root/ and name it new_import.sql
  • in BASH/PuTTY, run this (change rootpw, and dbname):
root_pw='YOUR_PASSWORD_HERE'
db_name="YOUR_DB_NAME"
mysql -u root -p${root_pw} -D $db_name < /root/new_import.sql

If you need help with this, let me know.

View the original comment

Have another answer? Share your knowledge.