0

how to import sql into phpmyadmin on cpanel server.i tried to import, but it uploading long time then displays timeout error.

i uploaded my magento site into cpanel but while uploading mysql timeout occurs.

please help me how to handle this???

heart hacker
  • 431
  • 2
  • 8
  • 22
  • 2
    If that is the only way you can upload a database, then you are going to have to split the backup file into smaller sections – RiggsFolly Jan 21 '17 at 11:29
  • how can i split database file???\ – heart hacker Jan 21 '17 at 11:30
  • Assuming its a SQL based backup. Use a decent editor to break it into more than one file and upload them one by one. – RiggsFolly Jan 21 '17 at 11:32
  • Or FTP the file up to your server and use SSH Terminal to run the restore using the mysql command line tool `mysql` – RiggsFolly Jan 21 '17 at 11:33
  • @RiggsFolly thank you for your support but i dont know how to handle FTP method...i found this (http://stackoverflow.com/questions/16707532/how-to-solve-time-out-in-phpmyadmin) but php.ini file cannot found in my cpanel server file manager... – heart hacker Jan 21 '17 at 11:36
  • You will almost definitely **not** be allowed to amend the `php.ini` – RiggsFolly Jan 21 '17 at 11:47
  • How big is the file? I've had this issue before and usually re-trying a few times with patience does the trick, if not, what RiggsFolly suggests but sometimes even splitting times out as well. – Syden Jan 21 '17 at 12:52

2 Answers2

1

Try using Sequel Pro , import should be successful. If still it fails clear the log and core_url_rewrite tables, so the database becomes lighter and reimport. Make sure run catalog url rewrite reindex after the import is successful to regenerate urls.

1

PHPMyAdmin does not rely on the timeout or memory limit set in cPanel and takes its values from the server default timeout specified in WHM. So if you need it increased, it can be increased via WHM >> Tweak Settings >> cPanel PHP max execution time (its default is 90 sec and you need root access to modify it.)

As the database size seems large as it is of a Magento website, I suggest you to try doing the 1st method (source using shell)

  1. Do you have shell access. If yes, log in to the user account as the cPanel user.Issue the following command

    mysql -u username -p

Enter the password when prompted and then enter the command use database_name;

replace database_name with the actual database name.

Now import the database by issuing the command

source /your/path/to/backup.sql;

where /your/path/to/backup.sql is the actual path to backup file.

  1. If this is not available, contact your hosting provider with the backup file and they should be able to source it for you.

  2. If you need the import to be done via cPanel provided PHPMyAdmin itself, then you need to increase the timeout specified in the beginning.

  3. Import the backup as chunks but it is more complex.

Siju V
  • 143
  • 1
  • 5