Archive for October, 2015

Connecting remote mysql database using ssh tunnel


The command used to create remote ssh tunnel(sample):

ssh -L 3306:localhost:3306 greenhorn@192.168.1.254

Command used to connect to server using ssh:

ssh greenhorn@192.168.1.254.com

Command to connect to database using user “greenhorn”:

mysql -u greenhorn -p

Command to use a database in particular. In this case I’m using “greenhornDb”:

use greenhornDb;

To show all the tables in the selected database I used command:

show tables;

WARNING:
If you have local mysql running on the same port 3360. You need to stop it first.

Reference:
access-your-mysql-server-remotely-over-ssh

End process running on specific port in Windows 8.1



The command used to view all the ports in use:

netstat -a -o -n

The command used to terminate a process:

taskkill /F /PID <PID-to-be-terminated>

Reference:
kills-the-process-at-a-certain-port-in-windows-7