Copy an entire database:
mysqldump LOCAL_DBNAME | ssh USER@REMOTE_HOST mysql -p REMOTE_DBNAME
Copy a single table:
mysqldump LOCAL_DBNAME LOCAL_TABLE | ssh USER@REMOTE_HOST -p REMOTE_DBNAME REMOTE_TABLE
This shortcut only works if you can access the local DB without a password. If you have to login to both local and remote MySQL servers, the MySQL password prompts get mashed together. You could specify the password on the command line like
but your shell may keep the password in its history so that anyone with access to your account could pick through your shell history and retrieve the password. Using the MySQL password prompt doesn’t do this.
Popularity: 3%
For PHP’s gethostbyname() to work properly, the server’s DNS must be properly configured with available nameservers in /etc/resolv.conf (on Linux boxes). Without a work domain name resolution kit, gethostbyname() returns the hostname supplied to the function.
Make sure /etc/resolv.conf contains several nameservers to query. The format is
nameserver xxx.xxx.xxx.xxx
nameserver yyy.yyy.yyy.yyy
Where xxx.xxx.xxx.xxx and yyy.yyy.yyy.yyy are the IP addresses of nameservers the host has permission to use.
OpenDNS is a free DNS service that allows public access to their nameservers at:
208.67.222.222
208.67.220.220
To use in /etc/resolv.conf use:
nameserver 208.67.222.222
nameserver 208.67.222.220
Using OpenDNS’s nameservers could even boost your server’s performance. Their goal is to provide some of the faster domain name resolvers on the internet for free.
Popularity: 2%