Creating a Readonly MySQL User
1. Log into MySQL
Linux
Run the command below on your server to login to mysql:Windows
Navigate into MariaDB/MySQL root directory and then login to MySQL:2. Create a new MySQL user
Run the command below to create a new user that can run a connection from anywhere (replacing ‘USER’ and ‘PASSWORD’ with a username and password you’d like to use):3. Grant read-only permission to the MySQL user
Run the command below to create a new user that can read data from anywhere (again replacing ‘USER’ and ‘PASSWORD’ with a username and password you’d like to use):Connecting to the Datamanager Database
-
Find the connection information for the table you would like to view in the top section of the edit “Data Group” page
- Database Name: Curator
- Host Name: 127.0.0.1
- Table Name: a_reports_data_group
- Use the connection details from the “Creating a Readonly MySQL User” and the database, hostname, and table name from the previous step to connect to your MySQL data source.
Troubleshooting Connections
- Ensure your firewall rules allow inbound traffic over port 3306 to allow remote connections to your database. If you are having trouble connecting, please contact your hosting team for further help.
-
By default, remote connections are not allowed on some operating systems (e.g. Ubuntu 20). You can run the commands
below to set up remote connections:
Determine the location of your MySQL config file by running the command below:
Open the file that is returned from these commands (i.e.
/etc/my.cnf
): Add the following line to the bottom of the file, wherexxx.ip.xxx
is replaced with your IP address, or you can use0.0.0.0
to allow remote connections from anywhere:Now save your file and restart mysql to allow remote connections: