Today I spent alot of the day sorting our development techniques to bring a best practise into what we do. We needed to both be able to connect to the same remote database but both be able to develop locally. So we decided to setup ssh tunnels to our mysql server.
You can quite simply open a ssh tunnel with your server using the following:
ssh -L 3307:domain.name.of.mysqlserver:3306 firstname.lastname@example.org
You can then connect to the server with php using the following,
DB_USER - root - DB_HOST - 127.0.0.1 :3307 - DB_NAME - db_name DB_PASS - root pass