PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Wednesday, February 2, 2022

[FIXED] Importing a large .sql file into a database - repeated timeout error myPHPAdmin

 February 02, 2022     import, phpmyadmin, timeout     No comments   

Issue

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?


Solution

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/



Answered By - Compoot
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing