1

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

Megan
  • 11
  • 1
  • 2
  • 1
    You are probably hitting the maximum upload size allowed http://stackoverflow.com/questions/2184513/php-change-the-maximum-upload-file-size – Anigel Aug 14 '14 at 12:31

4 Answers4

2

I was facing the same problem. The size of sql file was only 2MB. However I was able to execute sql file by zipping it first before uploading.

Adnan
  • 5,025
  • 5
  • 25
  • 44
  • This helped me produce an error message that led me to the documentation at https://docs.phpmyadmin.net/en/latest/faq.html#i-cannot-upload-big-dump-files-memory-http-or-timeout-problems . I proceeded to import the database from the MySQL command line as mentioned there. Thank you! – Osvald Laurits Dec 20 '19 at 10:30
0

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.

koosie
  • 54
  • 4
  • How would i do a full backup then? So i could get everything back onto my site? thanks – Megan Aug 14 '14 at 13:23
  • You need to do two seperate things. Upload all the files (html/php/css/images and so on) to the directory of your website. You could use ftp to achieve this , or restore it via the wizard in cpanel. Seperately you need to restore the sql file like i said before. – koosie Aug 14 '14 at 13:34
0

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.

Matthias Luh
  • 503
  • 6
  • 11
0

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.

Ibrahim Isa
  • 529
  • 3
  • 4