When you have a development MySQL server and a production server sometimes it comes in handy to move a copy from production to development. Usually it requires a mysqldump then scp to the other server and then loading the data. Here are some scripts you can use to issue single command:
Here are the normal command that we would have had to use:
Dump the database
mysqldump --opt database_name -u root -p > database_name.dump |
Copy the file
scp /path/to/file.dump user@server.com:/path/to/file.dump |
Then importing the data
mysql database_name -u root -p < database_name.dump |
Now for a single command:
This assumes you don’t need to have SSH and the ports are open
mysqldump db-name | mysql -h remote.com db-name |
This is done over SSH
mysqldump db-name | ssh user@remote.com mysql db-name |
This should save some time and make sure you have access to run the commands on both machines.
VMware is now giving up their base OS virtualization software which I think is one of the best ways to get the most out of your
Setting up ESXi – After setting up the server to enable the SSH using the following directions:
1. At the console of the ESXi host, press ALT-F1 to access the console window.
2. Enter unsupported in the console and then press Enter. You will not see the text you type in.
3. If you typed in unsupported correctly, you will see the Tech Support Mode warning and a password prompt. Enter the password for the root login.
4. You should then see the prompt of ~ #. Edit the file inetd.conf (enter the command vi /etc/inetd.conf).
5. Find the line that begins with #ssh and remove the #. Then save the file. If you’re new to using vi, then move the cursor down to #ssh line and then press the Insert key. Move the cursor over one space and then hit backspace to delete the #. Then press ESC and type in q to save the file and exit vi. If you make a mistake, you can press the ESC key and then type it :q! to quit vi without saving the file.
6. You can either restart your host or run ps | grep inetd to determine the process ID for the inetd process. The output of the command will be something like 1299 1299 busybox inetd, and the process ID is 1299. Then run kill -HUP <proccess_id> (kill -HUP 1299 in this example) and you’ll then be able to access the host via SSH.
7. log in from remote ssh root@IP_ADDRESS
If you forgot to add in the ssh server so you can log in remotely then you can follow these directions for installing SSH to access your computer remotely.
sudo apt-get install openssh-server |
You should be good to now log into the machine from remote login
Once in you might need to set the ROOT password which is disabled by default