For a personal project, I've set up mysql server on my personal pc. I want to query this server with python from seperate pc that will be on a different a wifi network. I've figured out how to interact with the mysql server from python when the two computers are on the same wifi network, but when I seperate them I'm not able to acsess the server from the second computer using the same credentials. Can someone share how I can set up the server so that I can acsess it from a remote computer on a different wifi network.
I have a Windows machine. Thanks!
The server host name is let to "LAPTOP-12345". I can't figure out how to change the host name from localhost to an IP that my second PC can connect with.
You can try to use Tailscale which is a common VPN service for homelabbing. It exposes your local network through Tailscale network. You just need to install tailscale on both computer, then you can connect to the mysql server using the hostname provided by tailscale and the corresponding port number.
Link to Tailscale: https://tailscale.com
I hope it fits your need, I am personally using Tailscale to expose my self-hosted services which allows me to connect them anywhere with Internet.