This article explains how to create a database profile with read_only access for app SQL for Confluence (Pro Edition).
Instructions
Follow the below steps:
- Login to the MySQL database.
Run the below query in your database to grant select permission to the specified user.
GRANT type_of_permission ON database_name.table_name TO 'username'@'localhost’;
Refer to the below example:
GRANT SELECT ON Confluence_database.* TO 'confluence_user'@'localhost';
- Log in as a Confluence Administrator and click > General configuration.
- From the left side panel, click SQL (Pro Edition) in the BOBSWIFT configuration section.
- Switch to tab View and modify data source profiles and click on Add profile.
- To fill the required details in the below screen, refer to this link.
Here in Username and Password add the user you have created in the database with read-only access. - After entering all the details, click on the Test connection button. If details are correct, it will display a message Connection successfully as shown in the below screenshot.
- Click Next button.
- Click Save profile button to save this new database profile.
- Verify that the new profile is available here.
- Navigate to the required page and click the Edit icon ().
- Add SQL macro and click Edit to open the macro settings.
- Select the read-only user Data source profile under the SQL statement section and enter the SQL statement to insert data as shown:
- Click Save settings.
- Click on Save button page.
- It will display the below message as the user has only read-only access to the database.