0

I have a .sql file (db) which I am trying to import using myphpadmin and keep getting a time out error. The file is 46.6 MB (zipped)

Please note I am not on XAMPP but using a Godaddy myphpAdmin platform to manage the database.

What I've tried:

  1. Re-downloaded the file as a zip file - and tried importing it. Still failed.

  2. For this option given in phpmyadmin import, I tried UNSELECTING this option > "Allow the interruption of an import in case the script detects it is close to the PHP timeout limit. (This might be a good way to import large files, however it can break transactions.)"....and I also tried importing the db keeping it selected, but this failed. Which should it be?

What else can I do?

Shadow
  • 33,525
  • 10
  • 51
  • 64
Compoot
  • 2,227
  • 6
  • 31
  • 63
  • 1
    Maybe [split mysql file](https://stackoverflow.com/questions/132902/how-do-i-split-the-output-from-mysqldump-into-smaller-files) and then import multiple files instead of one big file. – vee Nov 22 '21 at 14:32
  • 1
    There are ways to change timeout settings. Ask your hosting vendor support about that. And be aware that the provider you mentioned doesn't support a lot of that kind of customization. Your best bet is to split your SQL files into chunks and load them one by one. – O. Jones Nov 22 '21 at 14:42
  • I know I can do this - but surely 46.6 isn't even big??! – Compoot Nov 22 '21 at 14:52
  • by chunks, do you mean download each table.....it just doesn't seem correct that myphpadmin would be so clunky and not allow something so basic - for so small a file size – Compoot Nov 22 '21 at 14:52
  • It's problem with **phpMyAdmin** on Godaddy and I'm quite sure that you can't use command line like ssh to import via command line. If that case, there are few choice to do. 1. split MySQL file and 2. contact hosting vendor (Godaddy for your case) to get help with this. – vee Nov 22 '21 at 15:31
  • You really should not use phpmyadmin to import large files into mysql. It is a web-based application with limitations. – Shadow Nov 22 '21 at 15:51

2 Answers2

2

nothing worked, except SSH.

What you need: Database (that you are importing into) username and password Cpanel username and password + IP address (for Putty)

  1. I had to upload the .sql file to a folder on the public_html.

  2. Download pUtty

  3. In putty I needed the IP address (hosting server) as well as the cpanel username and password (so have that handy).

  4. Once in, you have to enter your cpanel's password

  5. Use the "cd" change directory command to change directory to where you have placed your .sql file.

  6. Once there, use the following command:

    mysql -p -u user_name database_name < file.sql*

(Note: replace 'user_name', 'database_name', and 'file.sql' with the actual name.)**

You will be prompted for your database password, and then your database will be imported.

Useful link: https://www.siteground.co.uk/kb/exportimport-mysql-database-via-ssh/

Compoot
  • 2,227
  • 6
  • 31
  • 63
1

You can try unzipping the file locally and importing the uncompressed .sql file; the overhead of uncompressing the file in memory could be the problem for phpMyAdmin. Generally, though, what Shadow said is correct and you should use some other means for import (like the command-line client). You could also use the phpMyAdmin UploadDir feature to put the file on the file in a special folder that phpMyAdmin can directly access on the server. This can help with a lot of the resource limits the webserver imposes.

Isaac Bennetch
  • 11,830
  • 2
  • 32
  • 43