first of all, u need to make sure the database server accept remote connection, and then you have the MySQL connector installed, and then you can just make a new MySqlConnection with the server name (ip address of the remote server and the port the mysql is installed), username, password, and database name.
you can read more on how to enable remote connection on mysql
here[
^]