Tuoboo's blog
Current Page: Home > Web Programming >

How import big mysql database by CPanel Cron Jobs

How import big mysql database by CPanel Cron Jobs
Sometimes, I want to import my big mysql database. I am using th Hostmonster website hosting which using the CPanel. At CPanel, I found that there is a MAX limit 10MB to import your mysql database by using PHPMYADMIN.

But my mysql database is about 20MB, How can I import my database?

I contact the Hostmonster Livechat, its staff tells me 2 methods:

1. What you'll need to do is upload the .sql file to the Home Directory (the folder before public_html) Then create a ticket with Site/Script compatibility. They are importing databases that are too large for you. Create the ticket there, give the name of the database and name of the .sql file to import and they will do this.

2.You can import it through SSH. To obtain SSH access, we just need you to make a ticket, where you attach a copy of your driver's license, passport, or other official government-issued Photo ID.

OK, now you can import your big mysql database follow Hostmonster staff's introduction.

BUT I have another method: using the Cron Jobs.

1. Use FTP upload your temp.sql or temp.sql.gz to the Home Directory.

2. Login into your CPanel, find the icon of Cron Jobs, SET it. Because we just need the cron job run a time, so we set it execute Cron Jobs after 2 minutes.

3、Command as below:
mysql -hhostname -uusername -ppassword databasename < backupfile.sql

If your database is sql.gz, you can use this command:
gunzip < backupfile.sql.gz | mysql -uusername -ppassword databasename

OK, that's it.
Tag: import big mysql database, CPanel, Cron Jobs
Author: Administrator. Time: Mar 18th, 2011 16:48
  • 1 Lily says:
    Mar 18th, 2011 02:57
    I am very enjoyed for this blog. Its an informative topic. It help me very much to solve some problems. Its opportunity are so fantastic and working style so speedy. I think it may be help all of you. Thanks.
*Name
Email (will not be published)
Website
(*Verification Code, Click to refresh.)