I am transferring my magento site from an old domain to a new domain.

I have exported the database file from the old server and I have done all the necessary changes.

Now I'm trying to run the exported file into the new database but sql is stuck at loading for almost an hour.

Please somebody help.

See loading screen attached. Image here

Thank you.enter image description here


This article will help you


or rather than running a sql query , create a SQL Dump and then import it

|improve this answer|||||

I have often times found that a disk was almost full only when trying to write a large amount of data, like an sql dump, takes a long time like this. I would check that the disks have space first. If that isn't an issue then I would check php's error logs and mysql's log. On many systems this is at /var/lib/mysql/.log or /var/log/mysql.log. You can also turn on slow query logging in mysql's config file. A crashed table can also cause very bad iowait which could make importing a large database take a long time. Look for mysql log lines that say 'table xyz is marked as crashed and should be repaired' or something to that effect. Also, check for other processes that could be using the disks and causing iowait. If you want to see if the process is actually hung and not just running slowly you can see its syscalls with the strace command. Using the ps command you can find the php process as well as the mysql process that is importing the dump file and run

strace -p <pid>

to see what that process is actually doing.

I have an easier time troubleshooting using the mysql terminal client. This also takes away any question of there being php/web server issues. You can import the dump file with the following command:

mysql -h <host> -u <username> -p'<password>' <database name> < db_dump.sql 
|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.