Solved

Is MySQL CLI secure

Posted on 2011-09-30
1
216 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

Foreword This is an old article.  Instead of using the MySQL extension that was used in the original code examples, please choose one of the currently supported database extensions instead.  More information is available here: MySQLi / PDO (http://…
This article shows the steps required to install WordPress on Azure. Web Apps, Mobile Apps, API Apps, or Functions, in Azure all these run in an App Service plan. WordPress is no exception and requires an App Service Plan and Database to install

734 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