I'm using software to access MySQL remotely. Can I connect to the database via https so the connection is safe?
For example, using a host of https://mydomain.com.
HTTPS is for connecting to web servers, not database servers. See the following MySQL documentation:
Using SSL for Secure Connections
How you use this from an application will depend on the language and driver. See this question for how to do it using PHP with the MySQLi extension.
Related
I am new to setting up SSL certificates on servers and would need some help to secure a MySQL database connection. I have a simple mobile app (client) which needs to connect to a remote MySQL database (server) connection. I am using AWS EC2 for the remote server and I have installed Let's Encrypt SSL certificates on a domain that I am hosting there. The machine runs on Ubuntu 18.04 and NGINX.
The same server also runs a MySQL database and I want to connect to it securely using a mobile app client. How can I encrypt the connection between the mobile app aclient and the MySQL database server?
I do have a static ip address for the database server but I am unable to install SSL certificates on the ip address directly. Only the domain name has an associated SSL certificate.
I did some digging around but was unable to find anything that serves my purpose. Any suggestion or reference to an article would greatly help.
This article provides a detailed step by step procedure for securing the connection between a remote MySQL database server and a client.
Securing a remote MySQL database server connection
I have a MySQL server database running on Azure. It has already running to store data from my ASPX web apps hosted on Azure also. I have plan to migrate the apps to Java JSF or .net core.
I developed using Tomcat server (in my local pc) and try to connect directly to mySql in Azure. But I always get Communications link failure error.
Is it not allow to connect directly from my local Tomcat server to database in Azure, or something else?
Thank you in advance for the answer.
Yes you can connect from your local tomcat to your azure mysql if you have provided the correct connection string.
Also add your ip in the firewall rules of the sql resource.
I have a mysql database and an applet in some free hosting site. The applet needs to access that mysql database. How do I do that ? Is it possible to remote access mysql database from an applet? how ?
The applet will execute on the client browser.
Its doubtful/unlikely that your free hosting provider allows remote mysql connections.
So your best bet would be some sort of HTTP web service.
If you can use Java on the server then check out CXF.
If you can only use PHP then things are tougher but look at NuSOAP.
On your applet you can use CXF to consume the service.
Hi Thanks for reading my question. I currently use Mac Terminal to use MySQL. I connect to either localhost or a remote server. Should I be using SSH?
You won't need SSH to access a DB on your local machine.
You can use SSH to access a remote DB using MySQL. You can also use an app with a GUI like Sequel Pro to access the remote DB via an SSH tunnel.
What specifically are you trying to achieve?
There is not enough information to answer your question.
Normally SSH tunnels are used more for adhoc work, while preserving high level of security (can be used in production, too).
MySQL normally uses unencrypted traffic, but it can be setup to use SSL, so that's another path you can take.
Other alternatives are VPNs, for example OpenVPN among other solutions, but this is more of an infrastructure decision.
EDIT: For completeness
On local machine clients can communicate with mysqld over socket or local IP. Normally it is not necessary to encrypt such connections.
For remote connections (which are over IP), as stated mysql uses unencrypted connection and FTP by default also uses unencrypted connection. This might or might not be a security risk (if that particular network segment is on its own VLAN or inside already encrypted tunnel or on physically secured network).
If unsure - encrypt it.
I was wondering if there is a way to access a database service on a remote computer without having a webserver installed on that computer?
Does MYSQL DBMS provide some interface (port) which can be connected directly to, or is a webserver (that forwards the communication) mandatory?
MySQL can be access by default on port 3306.
Normally this port will be blocked by the firewall though, as it's not good practice to have your DB server accessible to the outside world.
If you want to access a remote database via the command line you can use the mysql client.
If you're doing this over the internet you should probably use a tunnel or VPN for security.
You can connect to MySQL using ODBC. Default Port 3306
As they said. You can connect with mysql using the (default por 3306). You may use mysql client, or the ODBC, JDBC, or ADO.Net interfaces. There are connectors for most of the main programing languages.
If you are looking for a user-friendly tool to use mysql like PHPmyAdmin you may like MYSQL GUI Tools
http://dev.mysql.com/downloads/gui-tools/5.0.html