phpMyAdmin – Connection reset when trying to import files

I am new to using PHP My Admin, i have read answers for this question before but i dont understand them and need a more in depth, simpler explanation.

I backed up my wordpress website, then moved host. So now my website is back to square 1 and i need to use my backup to get everything back. I read that to do this, i need to go onto my cpanel>phpmyadmin, then select database>my database>import. I selected the zipped file of my backup and imported it, but it then says ‘connection reset’ and doesnt do anything. After research it seems like a lot of people have this problem! The zip file is 654,613kb. What do i do? Thanks

Related posts

Leave a Reply

4 comments

  1. I think you are trying to import the complete backup (including images etc) into a mysql database. A database of somewhere around 650 Megabytes is very big. Do you have .sql file in the zip folder? try importing that one.

  2. I faced the same error (not in cPanel though, but with VestaCP, but I think that’s not a big difference).
    The phpMyAdmin FAQ imply that there are improvements importing databases in newer versions (starting with 2.7). However, it would have been complicated to update phpMyAdmin for us.

    Instead of using phpMyAdmin, I directly used mysql commands via SSH.

    1.Export and transfer from old server:

    mysqldump --single-transaction -h localhost -u db_user –pdb_password db_name > db_bak.sql
    rsync -avx -P /root/db_bak.sql root@xxx.xxx.xxx.xxx:/home/admin/db_bak.sql
    

    2.Import on new server (be careful, all old data in db_name database is deleted by DROP command):

    cd /home/admin
    mysql -h localhost -u db_usr -pdb_pw -e "DROP DATABASE db_name"
    mysql -h localhost -u db_usr -pdb_pw -e "CREATE DATABASE db_name CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci"
    mysql -h localhost -u db_usr -pdb_pw db_name < db_bak.sql
    

    Change db_user/db_usr to your old/new database username, db_password/db_pw to your old/new password (no space between password and -p), db_name to your database name and (if required) localhost to your server.

  3. Zipping the file solves the problem, for example the file you are trying to import is “example.sql” you compress it to zip format and have it renamed as “example.sql.zip” before selecting it in the file explorer for import.