In certain situations importing a large sql file into a database in phpMyAdmin may fail/timeout. The better alternative is to run the mysql command in terminal. This is extremely fast (importing a 320 MB .sql file took just 1 second in my testing).
If you are on a Mac, the location of mysql installed by DesktopServer is /Applications/XAMPP/xamppfiles/bin. For the mysql command to work in terminal, first check if it is in the $PATH variable by opening a terminal, typing the following and pressing return:
echo $PATH
It may look like this:
/Users/sridharkatakam/.nvm/versions/node/v5.6.0/bin:./node_modules/.bin:/usr/local/git/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
As the location of mysql is not present, mysql can temporarily (until the computer restart) be added to the $PATH like so:
export PATH=${PATH}:/Applications/XAMPP/xamppfiles/bin
Now running echo $PATH may show something like:
/Users/sridharkatakam/.nvm/versions/node/v5.6.0/bin:./node_modules/.bin:/usr/local/git/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/XAMPP/xamppfiles/bin
Then open a terminal in /Applications/XAMPP/xamppfiles/bin and issue the mysql command. To import super.sql
into a krypton
database having clark
username and kent
password (these can be seen in wp-config.php) run:
mysql -h localhost -uclark -pkent krypton < super.sql
Note that there should not be a space after between -u and the username and -p and the password.
References:
http://stackoverflow.com/a/8195442/778809