Importing large databases to virtual hosts with cPanel
no longer FRET for uploading the database - import a large database
with cPanel to virtual hosts, everyone knows that phpMyAdmin import database has a size limit, and the time is a little longer, and time out has failed.
there are also various kinds of software to import on the Internet. Usually, the method of cutting SQL files into multiple packages is trivial, and the success rate is not very high.
if your database is large, you will often be upset.
I have been directly logon to the virtual host using SSH directly to run the following commands to import:
mysql -u username -p password [-h database host] database.Lt; database backup.Sql
but many space providers do not give open or permission.
suddenly thought that you could use crontab to run commands. The test was successful.
1. uploads your backup SQL file through FTP and puts it in the root directory.
2. enters your cPanel, see the cron jobs icon, click in, and select Advanced (Unix Style) (ha ha I'm more used to UNIX HA).
because it only needs to run once, so Minute, Hour, Day, Month all fill in the ready time, leave two minutes (if the virtual host is not local, you can look at the host time on FTP), Weekday fill the number.
Command to fill in the command to run, is the Import command:
mysql -u username -p password [-h database host] database.Lt; database backup.Sql
speed is very fast, my 1G database is also a few minutes.