Never been to TextSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

About this user

« Newer Snippets
Older Snippets »
2 total  XML / RSS feed 

SSH tunnel for mySQL

Connect to remote mysql server via ssh tunnel:

ssh -f -L 3306:127.0.0.1:3306 username@servername.com sleep 120


Should auto-disconnect when it’s no longer in use.

mySQL

Add database user:
grant select, update, create, insert, delete on database.* to username@localhost identified bypassword‘;


Database export:
mysqldump -u root -p database > filename.sql


Database import:
mysql -u root -p database < filename.sql
« Newer Snippets
Older Snippets »
2 total  XML / RSS feed