Skip to end of banner
Go to start of banner

How to create a database profile with read-only access in SQL for Confluence

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 9 Next »

This article explains how to create a database profile with read-only access to be used in the sql macros for the app SQL for Confluence (Pro Edition).

Instructions

Follow the below steps:

  1. Log into the MySQL database.
  2. Run the below query in your database to grant SELECT permission to a specific 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';
  3. Log in as a Confluence Administrator and click  General configuration.

  4. From the left side panel, click SQL (Pro Edition) under the BOBSWIFT Configuration section.
  5. Switch to tab View and modify data source profiles and click +Add profile
  6. To fill the required details in the below screen, refer this link.
     In the fields Username and Password, add the details of the user that you created in the database with read-only access.
  7. After entering all the details, click Test connection. If the given details are accurate, it displays a message Connection successful as shown in the below screenshot.
  8. Click Next
  9. Click Save profile to save this new database profile.
  10. The new profile is available here.
  11. Navigate to the required page and click the Edit icon ().
  12. Add SQL macro and click Edit to open the macro settings.

  13. Select the read-only user as Data source profile under the SQL statement section and enter the SQL statement to insert data as shown in the below screenshot:

  14. Click Save settings.
  15. Click Save.
  16. It displays the below message as the user has only read-only access to the database.
  17. Read-only access will be available to retrieve database information.

    The output of the above query:



  • No labels