blog

Small tips to Optimize your day PT I (phpMyAdmin and FTP are slow)

July 01 2010 by Joseph Smith

If your reading this, you've probably witnessed how long it can take to transfer files via FTP (current standard was adopted in October 1985). Your FTP client will tick away the seconds of your life while you patiently wait 20-30 minutes for that 50 MB folder worth of files to make it's way home.

And if that's not bad enough try performing a mysql import via phpMyAdmin on remote server with anything over 10 megs (sometimes less). It might work, it might not. You shouldn't have to ask "Will it succeed this time? Safari's been spinning for awhile... maybe it's dead...". You have better things to do.

SCP a lighter, faster alternative to FTP

wanna put something on your remote server quickly?

scp SOURCE_FILE REMOTE_USER@REMOTE_HOST.COM:/DESTINATION_FILE

taking it back off again is the same story only in reverse

scp REMOTE_USER@REMOTE_HOST.COM:/SOURCE_FILE DESTINATION_FILE

scp REMOTE_HOST.COM can also be an IP address.
AND pay attention to the : that separates your host information from your file information

Don't be afraid of mysql commands

need to import your DB?

mysql -u DATABASE_USER -p -h HOST DATABASE_NAME < FILE.sql

dumping a DB? almost the same command only in reverse

mysqldump -u DATABASE_USER -p -h HOST DATABASE_NAME > FILE.sql

This effectively translates to interface with MySQL with the user (-u) and prompt for a password (-p) on a specific host (-h), Then import/dump FILE.sql to/from DATABASE_NAME.

For DB dumps, you will need to have permission to 'LOCK' the DB, typically slightly beefer permission level then what is required to import (surprisingly enough)

---

This is all pretty trivial stuff but it will shave quite a bit of time off your day if you take the wrong path and go for the GUI. Time is money, you should be making it and moving on to better things, rather than waiting for operations like DB imports and file transfers.

While you're at it, timestamp

While you're at it, timestamp that DB dump you're doing with date

site_name_$(date +%Y-%m-%d-%H%M.%S).sql

Post new comment

The content of this field is kept private and will not be shown publicly.
By submitting this form, you accept the Mollom privacy policy.

Joseph Smith

Joseph Smith

Joseph currently works full-time as a freelance developer on projects for twoHard.

In his past life, he was a touring musician and turned screws on/repaired Apple hardware.

Tags