You mentioned MySQL in the topic, so I will assume you are using that. MySQL uses network based connections naturally. If you are working on the machine that hosts the server, the login becomes user@localhost. To login from a remote location you will need to create a user account for user@remotehost. If you have a LAN domain, the remote host will probably be the fully qualified domain name of the host. If are accessing remotely, from the internet, you will need to add port forwarding in addition to the user@host.
You can also use wild cards to mask out all or part of the host name. This degrades the security so you will need to think carefully about this.