Connect to MySQL/MariaDB from a different machine

IMPORTANT: Making this application’s network ports public is a significant security risk. You are strongly advised to only allow access to those ports from trusted networks. If, for development purposes, you need to access from outside of a trusted network, please do not allow access to those ports via a public IP address. Instead, use a secure channel such as a VPN or an SSH tunnel. Follow these instructions to remotely connect safely and reliably.

To connect to your database server remotely using the MySQL client, follow these steps:

NOTE: Ensure that your virtual machine has a local network IP address. To configure your virtual machine to connect to your local network, refer to these instructions. Once connected, you can obtain the IP address of your virtual machine at any time by running the command ifconfig -a in the virtual machine server console.

Comment out this line by placing a hash (#) symbol at the beginning, so that it looks like this:

#bind-address=127.0.0.1

Save the file.

At the server console, allow remote access to the database server using the MySQL command line client. Use the following command, remembering to replace PASSWORD with the application password from the first step: