Setup SSL on remote MySQL server for mobile app - mysql

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

Related

Django deployment with mysql database on personal server

I am working on deploying my Django project on Linode. My MySQL database that I used during development was on a ubuntu server that I have at my house. This was different that the computer I wrote the program on. In the settings.py file I had the database connections set up and working. On my personal server at home I have updated the UFW to allow the new linode ip address and granted privileges to the ip address also. When I go to run the server on deployed project on linode, I get an error (2003, "Can't connect to MySQL server on 'personal server ip address':3306' (110)").
How do I get the linode server to be able to talk to my personal server's MySQL database?
Iiuc, you are trying to connect from linode to your home server - this is an odd configuration and will be problematic
what you need to do is to allow incoming connections at the router level so that packets are not dropped via port forwarding - I think your router is blocking the incoming DB connection
But like Yevhen said - it is a better approach to have MySql in Linode directly

Redirect FTP requests

I have an application that connects to a domain using port 3306 (MySQL) and port 21 (FTP).
I've had to move the MySQL hosting to another server (AWS) and need to keep the FTP server as is.
Now the problem I have is that the application doesn't allow you to specify a different server name for each service so it's trying to connect via FTP to the MySQL server in AWS.
Is there any way to setup Windows to redirect certain ports only to a different IP?
Is there a way to set up the new server to bounce FTP requests back to the older server?
Alternatively is there a way to setup the domain DNS to point MySQL port requests to the MySQL server?
One of the ways to fix this is, install a TCP proxy server (Eg. nginx, haproxy) on the new server and pass the request to the old server based on the request type.

Secure remote MySQL connection via https

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.

Access to mysql database in the Server from client PC

I have a database in my localhost(Use WAMP server).I have created a WiFi network among several laptops.There is a C# application on client laptop which need to use the database in server(This application uses the data in the database).How do I do this?
(The client laptop can connect to my wamp server through browser successfully with address
192.168.16.2).
You need to do three things
Ensure that the application has the correct details to make the connection i.e username, password, database and hostname
Ensure that the server is using TCP/IP protocol (perhaps SSL) and that the firewall will not prevent incomming connections.
Ensure that the database user can connect from the remote machine. This can be achieved using the Workbench application.

Mysql Connecting remotely

I'm having a problem running a MySQL server that is hosted on another server that isn't the web hosting server. Currently my web server is running on godaddy's free linux hosting. They do offer a MySQL database free, but you can't connect remotely (Sequel Pro OSX program) without paying for an upgraded hosting plan. So temporally, I'm going to host the database on my server at home (XAMPP). Well, whenever I try to connect to the database using the PHP command mysql_connect() I'm getting an error:
"Warning: mysql_connect() [function.mysql-connect]: Lost connection to MySQL server at 'reading initial communication packet', system error: 110"
before it was saying 113 (I believe).
Any-who, I tied to use the 'Bind-address' and changed it from 12.0.0.1 to my LAN IP. it didn't work or I didn't do it right. So, any help I can get on this would be awesome.
FYI, I can connect to the database remotely from inside my network using Sequel Pro. But the godaddy server can't connect. Port is open also, so that's not the problem.
Out of the mouth of a godaddy support guy, "Our shared hosting plans do not give you the ability to connect to an external database. If you wish to have this ability, you would need to look into one of our server hosting options."
So, my configuration is correct, it's just godaddy has it blocked. Lame! Thanks everyone for the help.
If you're hosting your database to a home local machine, you should also redirect router "xxx" TCP port to 3306 TCP port of hosting pc.
Remember you must connect to WAN ip on port "xxx".
You can use free dns services like dyndns to map your internet connection to a name (example yourname.dyndns.org)
Redirect a port (default 3306) of your router to 3306 TC port of your hosting pc (internal)
From remote pc connect to yourname.dydns.org:3306 or to port you redirected on router