Connect to MySQL/MariaDB from a different machine
NOTE: We are in the process of modifying the configuration for many Bitnami stacks. On account of these changes, the file paths and commands stated in this guide may change depending on whether your Bitnami stack uses MySQL or MariaDB. To identify which database server is used in your stack, run the command below:
$ test -d installdir/mariadb && echo "MariaDB" || echo "MySQL"
The output of the command indicates which database server (MySQL or MariaDB) is used by the installation, and will allow you to identify which guides to follow in our documentation for common database-related operations.
IMPORTANT: Bitnami Native Installers do not modify the firewall configuration of your computer, therefore the Redmine+Agile ports could be open which is a significant security risk. You are strongly advised to close the Redmine+Agile ports (refer to the FAQ for more information on this).
To connect to your database server remotely using the MySQL client, follow these steps:
Windows, Mac OS X, Linux
-
Open port 3306 in your firewall. For example, if you are using ufw, you would run the following commands (on Linux only):
$ sudo ufw allow mysql/tcp
-
Edit the MySQL configuration file and find the line containing:
bind-address=127.0.0.1
-
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 command line client. Use the following command, remembering to replace PASSWORD with the application password from the first step:
$ installdir/mysql/bin/mysql -u root -p -e "grant all privileges on *.* to 'root'@'%' identified by 'PASSWORD' with grant option";
-
When prompted for a password, enter the password you entered during the installation process.
-
Restart the database server using the graphical manager (Windows and macOS or by executing the following command at the server console (Linux):
$ sudo installdir/ctlscript.sh restart mysql
You can then connect to the database server using a command like the one below.
$ mysql -h 127.0.0.1 -P 3306 -u root -p
You will be prompted to enter the root user password. This is the same as the application password.
Mac OS X-VM
-
Select the “Network” tab, then click “Add”.
-
On the resulting dialog, enter 3306 as local and remote port. Active the “Require local” and “Over SSH” checkboxes, and click “Ok” to save your changes.
-
On the “Network” section, you will see an SSH tunnel to the 3306 port enabled.
-
If the connection is successful, click “OK” to save the connection.
You can then connect to the database server using a command like the one below.
$ mysql -h 127.0.0.1 -P 3306 -u root -p
You will be prompted to enter the root user password. This is the same as the application password.