Sunday, January 30, 2011 

Create tunnel via the ssh command in linux.

For windows you can configure putty with the tunnel.


For linux use the following command.

ssh -i <yourkeyfile> -f user@personal-server.com -L
2000:personal-server.com:25 -N

The -f tells ssh to go into the background just before it executes the
command. This is followed by the username and server you are logging
into. The -L 2000:personal-server.com:25 is in the form of -L
local-port:host:remote-port. Finally the -N instructs OpenSSH to not
execute a command on the remote system.

Wednesday, January 19, 2011 

Find tables which are empty in database.

Find tables which are empty in database use the following query

SELECT `TABLE_NAME` FROM `TABLES` where `TABLE_SCHEMA` = '<your db schema name>' and `TABLE_ROWS` = 0 or `TABLE_ROWS` is null;

Find tables which have MyISAM engine in database use the following query.

SELECT `TABLE_NAME`,`ENGINE` FROM `TABLES` where `TABLE_SCHEMA` = '<your db schema name>' and `ENGINE` = 'MyISAM'