So you have this HUGE MySQL SQL file of your PHP-Nuke site/blog/whatever. Like 500MB in size which PHPMYADMIN is unable to handle just by a regular browser upload. What do you do? Split the file into 3248723489 segments and upload them 1 by 1? Noooo indiano...
Well here's another alternative. With just 2 simple steps and a simple command (SSH command), you won't have to worry about opening the SQL file in wordpad ever again!
Step 1 - Upload the SQL file to your server. Lets assume the path to the file is:
/home/myserver/public_html/mysqlfile.sql
Step 2 - Run the SSH command:
Code:
mysql -u[username] -p[password] [name-of-db] < /file/to/the/db.sql
Assuming I have the following database info:
database name: mydatabase
database user: kenetix
database pass: mypass123
You will key this code in the terminal window (replacing all the database variables and the file path obviously):
Code:
mysql -ukenetix -pmypass123 mydatabase < /home/myserver/public_html/mysqlfile.sql
Simple? Yes, very. 2 things you may want to take note of:
- There is NO SPACE between the -u and -p commands (username/password).
- No status report will be given if the dump is successful. Just check the tables manually.
Hope this has been helpful. It definitely saved me lots of time backing up/restoring Kenetix.net numerous times.
Wow, okay thats great to know, will save me alot of time. Do you now about gunzip or the unzip command, or this command, * sh? I always have problems with that telling me files/directories not found when I know they're there, and I try to chmod them and it silently succeeds so... Let me know
Posted By:undergrew | Date: Tuesday, Sep 30 2008, 07:41 AM