Before ingesting MariaDB metadata into Dawiso, create a dedicated MariaDB user and grant it access to the metadata of the databases you want to ingest.
Dawiso reads metadata only from INFORMATION_SCHEMA. It doesn’t read the data stored in your tables. MariaDB shows an object in INFORMATION_SCHEMA only to users who hold a privilege on that object, so the user needs the privileges below even though Dawiso never queries your data.
Dawiso Cloud currently supports the traditional authentication method using credentials.
Supported MariaDB versions
- MariaDB 10.5 and later. Dawiso has been verified on MariaDB 10.5, 10.6, 10.11, 11.4, 11.8, and 12.3.
The privilege for reading procedure and function code differs between MariaDB 11.2 and earlier and MariaDB 11.3 and later. The steps below show both.
Connection prerequisites
- You have the global
CREATE USERprivilege. - You hold each privilege you grant below
WITH GRANT OPTION. MariaDB only lets you grant privileges you have yourself.
Create a new user
First, create a new dedicated user using the following statement:
CREATE USER 'user_name'@'%' IDENTIFIED BY 'password';
Replace user_name and password with your values. The % host lets the user connect from any address. To restrict it, replace % with the IP address Dawiso connects from. Refer to the official MariaDB documentation for more details.
To ingest metadata from your on-premises sources, whitelist Dawiso’s IP address so Dawiso can connect to your internal sources (pull method). Whitelist the same IP for Dawiso Integration Runtime (DIR) to send data from your on-premises infrastructure to Dawiso Cloud (push method).
Contact your Account Manager to get the Dawiso IP address.
Grant permissions to the user
In the following statements, replace user_name with the user created in the previous step.
Grant access to each database
Run the following statement for every database you list in the Dawiso data source. Replace database_name with the name of the database.
GRANT REFERENCES, SHOW VIEW ON `database_name`.* TO 'user_name'@'%';
REFERENCES makes the tables, views, columns, sequences, and foreign keys of the database visible to the user. It doesn’t let the user read or change data. SHOW VIEW is needed for view definitions, together with the grants in Grant access to view definitions.
In a database-level GRANT, the characters _ and % in the database name are wildcards. For example, GRANT … ON `sales_eu`.* also applies to a database named salesXeu. To grant access to exactly one database, escape these characters with a backslash: GRANT … ON `sales\_eu`.*.
Grant access to procedure and function code
The privilege that lets Dawiso read the code of stored procedures and functions depends on your MariaDB version. Neither privilege lets the user run procedures or functions.
Run the following statement for every database you list in the Dawiso data source:
GRANT SHOW CREATE ROUTINE ON `database_name`.* TO 'user_name'@'%';On MariaDB 11.2 and earlier, this statement fails with a syntax error (1064) because the privilege doesn’t exist there.
MariaDB 11.2 and earlier have no privilege for routine code that can be limited to a database. Run the following statement once:
GRANT SELECT ON mysql.proc TO 'user_name'@'%';mysql.proc holds the definitions of all stored procedures and functions on the server, so the user can read the code of the routines in every database. The table holds no data from your tables. This statement also works on MariaDB 11.3 and later.
Without one of these privileges, Dawiso doesn’t ingest procedures, functions, or their parameters.
Grant access to view definitions
MariaDB shows the SQL definition of a view only to users who have both the SHOW VIEW and the SELECT privilege on that view. Without SELECT, Dawiso ingests the view and its columns, but the view’s Definition (SQL) stays empty.
Grant SELECT on each view in the databases you ingest. To generate the statements for all views in a database, run the following query and then run the statements it returns. Replace database_name and user_name with your values.
SELECT CONCAT('GRANT SELECT ON `', REPLACE(TABLE_SCHEMA, '`', '``'), '`.`',
REPLACE(TABLE_NAME, '`', '``'), '` TO ''user_name''@''%'';')
FROM INFORMATION_SCHEMA.VIEWS
WHERE TABLE_SCHEMA = 'database_name';
SELECT on a view lets the user query the data the view returns, but not the tables behind it. Granting it per view keeps that access limited to views. Views created later need their own grant, so run the query again after you add views.
Grant access to triggers and events
MariaDB lists a trigger only to users with the TRIGGER privilege, and an event only to users with the EVENT privilege. To ingest triggers and events, run the following statement for every database you list in the Dawiso data source:
GRANT TRIGGER, EVENT ON `database_name`.* TO 'user_name'@'%';
MariaDB has no read-only privilege for triggers and events. TRIGGER also lets the user create and drop triggers, and EVENT lets the user create, change, and drop events in the database. Dawiso only reads triggers and events and never creates, changes, or drops them. If your security policy doesn’t allow these privileges, skip this statement: the ingestion still completes, without triggers and events.
What each privilege is for
| Privilege | Scope | What Dawiso ingests with it |
|---|---|---|
REFERENCES | Each ingested database | Tables, views, sequences, their columns, and foreign keys. |
SHOW VIEW | Each ingested database | View definitions, together with SELECT on the view. |
SELECT | Each view | View definitions, together with SHOW VIEW on the database. |
SHOW CREATE ROUTINE | Each ingested database | Procedures, functions, their parameters, and their code (11.3 and later). |
SELECT | mysql.proc | Procedures, functions, their parameters, and their code (11.2 and earlier). |
TRIGGER | Each ingested database | Triggers and their code. |
EVENT | Each ingested database | Events and their code. |
If a privilege is missing, the ingestion still completes, but the objects that depend on it are missing in Dawiso or have an empty definition. If the user has no privilege at all on a database listed in the data source, the ingestion fails.
Sample script
You can copy and paste the following script and run it on your server. Replace my_database and my_view with your values.
CREATE USER 'DawisoIntegration'@'%' IDENTIFIED BY 'password';
-- Repeat for each database you list in the Dawiso data source
GRANT REFERENCES, SHOW VIEW ON `my_database`.* TO 'DawisoIntegration'@'%';
GRANT SHOW CREATE ROUTINE ON `my_database`.* TO 'DawisoIntegration'@'%';
GRANT TRIGGER, EVENT ON `my_database`.* TO 'DawisoIntegration'@'%';
-- View definitions: repeat for each view
GRANT SELECT ON `my_database`.`my_view` TO 'DawisoIntegration'@'%';CREATE USER 'DawisoIntegration'@'%' IDENTIFIED BY 'password';
-- Repeat for each database you list in the Dawiso data source
GRANT REFERENCES, SHOW VIEW ON `my_database`.* TO 'DawisoIntegration'@'%';
GRANT TRIGGER, EVENT ON `my_database`.* TO 'DawisoIntegration'@'%';
-- Procedure and function code, once for the server
GRANT SELECT ON mysql.proc TO 'DawisoIntegration'@'%';
-- View definitions: repeat for each view
GRANT SELECT ON `my_database`.`my_view` TO 'DawisoIntegration'@'%';To generate the GRANT SELECT statements for all views, use the query in Grant access to view definitions. To leave out triggers and events, remove the GRANT TRIGGER, EVENT line.
Don’t grant SELECT ON INFORMATION_SCHEMA.*. MariaDB rejects it with error 1044, and the statements after it in a script don’t run. Access to INFORMATION_SCHEMA comes from the privileges above.
Verify permissions
Connect as the new user and run the following queries. Replace my_database with your value. Compare the results with the same queries run by an administrator: the numbers must match.
SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'my_database';
SELECT COUNT(*) FROM INFORMATION_SCHEMA.ROUTINES
WHERE ROUTINE_SCHEMA = 'my_database' AND ROUTINE_DEFINITION IS NOT NULL;
SELECT COUNT(*) FROM INFORMATION_SCHEMA.VIEWS
WHERE TABLE_SCHEMA = 'my_database' AND VIEW_DEFINITION <> '';
SELECT COUNT(*) FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_SCHEMA = 'my_database';
SELECT COUNT(*) FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_SCHEMA = 'my_database';