Code and Settings

Connection Via SSH Tunnel (MySQL)

Due to security considerations we do not allow connections to our normal MySQL server from outside our network. The negative impact it will bring to our customers is that (but on) can not connect to their databases via external software (eg MySQL Workbench) which is troublesome for many who prefer to work on these instead of via our web-based tools (such as phpMyAdmin). The solution to this is to use their SSH account with us to create a tunnel to send their traffic through and thus be able to m...

Can I manage MySQL databases via SSH?

SSH is very good at both import and export MySQL databases with MySQL command, so you can do both : Export a MySQL db to file: mysqldump -h [ SERVER ] -u [username] -p [ DATABASE ]> dumpfil.sql This command exports your database and save it as " dumpfil.sql " Importing a MySQL db from file : mysql -h [ SERVER ] -u [username] -p [ DATABASE ] < dumpfil.sql This command will import your dump file to the database , it will overwrite the existing tables with the same name

How to search for files and folders through SSH?

For example, to search for a file called myFile.txt under the current folder (and all subfolders), you would need to use the following command: find . -name myFile.txt If you are uncertain about the file name or would like to match a part of the name, you can use a wildcard pattern: find . -name “myFile*” If you would like to list only directories and leave all files out of the result: find . -type d Or if you want to filter only files modified for the last 2 days, you would ne...