Solved

Is MySQL CLI secure

Posted on 2011-09-30
1
214 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

More Fun with XML and MySQL – Parsing Delimited String with a Single SQL Statement Are you ready for another of my SQL tidbits?  Hopefully so, as in this adventure, I will be covering a topic that comes up a lot which is parsing a comma (or other…
Both Easy and Powerful How easy is PHP? http://lmgtfy.com?q=how+easy+is+php  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikipedia.org/wiki/PHP  Very powerful.  But a…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

776 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