Solved

Is MySQL CLI secure

Posted on 2011-09-30
1
215 Views
Last Modified: 2012-06-21
Good afternoon,
Ive usually done all my queries on my remote MySQL server  by using the MySQL CLI on my PC, however it occurs to me that it isnt secure. After a quick search on google Im stil not sure. Does anyone have any comments either way?

Thank you
0
Comment
Question by:tonelm54
1 Comment
 
LVL 23

Accepted Solution

by:
nemws1 earned 500 total points
ID: 36892732
Yes, MySQL connections are not secure.  Do you have SSH access to your server?  If so, you can create a secure tunnel using something like (this is on your client):

   ssh -L 3306:localhost:3306 server.whatever.com

Then just run 'mysql' and connect to '127.0.0.1' (Note: if you try to connect to the 'localhost' name here, it won't work, as mysql will assume you're running with a named socket on your local machine and try to connect to that, but that's not what you want)

On MySQL on the server, make sure you have access from your username and host "localhost" (the MySQL server will think you're connecting from the localhost when doing this).

You can easily use PuTTy as well for this, just go to Connection -> SSH -> Tunnels and add 3306 in "Source port" and "localhost:3306" in Destination and click Add.


If you don't have SSH access to this host (or any other hosts that might be on a secured network with it), then I don't think you can easily secure the connection.


Here are some other sites that perhaps have explained this better than I have:
  http://www.whoopis.com/howtos/mysql_ssh_howto.html
  http://kb.mediatemple.net/questions/133/Tunnel+local+MySQL+server+through+SSH
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This guide whil teach how to setup live replication (database mirroring) on 2 servers for backup or other purposes. In our example situation we have this network schema (see atachment). We need to replicate EVERY executed SQL query on server 1 to…
I use MySQL for many of my development projects in a Windows environment. To manage my databases (and perform queries) for years I used a tool called MySQL administrator.  This tool has since been replaced by MySQL Workbench. So I decided to m…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question