Solved

Is MySQL CLI secure

Posted on 2011-09-30
1
212 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
Comment Utility
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Foreword In the years since this article was written, numerous hacking attacks have targeted password-protected web sites.  The storage of client passwords has become a subject of much discussion, some of it useful and some of it misguided.  Of cou…
Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
This video discusses moving either the default database or any database to a new volume.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now