Database
Lets your agent answer questions from your own MySQL or MariaDB databases in plain language, with a safety mode you choose per database.
This guide begins with What Database does, continues through Connecting a database, Safety modes, and what they stop, Who is allowed to use it, and finishes with Getting good answers.
What Database does
Database connects your agent to your own MySQL or MariaDB databases. Instead of writing SQL yourself, you ask in ordinary language ("how many orders did we take last week?") and the agent looks at the schema, writes the query, runs it and answers with the real numbers.
You can connect several databases and give each one a short name you would say out loud, for example prod and staging. Then "how many test orders are in staging?" goes to the right one. With a single database configured you never have to name it.
It is your database and your credentials: Botonom stores them encrypted and passes them only to this skill, and the agent can do exactly what the database user you created is allowed to do.
Connecting a database
Open the agent, find Database in its skills and press Settings. Add one entry per database:
- Name - a short label you would say in a sentence:
prod,staging,reporting - Host and Port - where the database answers (port defaults to 3306)
- Database - the schema name
- Username and Password - the account the agent will use
- Use SSL/TLS - turn on if your server expects an encrypted connection
- Safety -
guarded(recommended) orunrestricted, explained below
Press Add for a second database. Removing an entry removes only that one; the others keep their own passwords.
Your database has to be reachable from the internet for the agent to connect. If it sits behind a firewall, allow Botonom's address or expose a tunnel endpoint. Addresses on a private network are refused on purpose.
Safety modes, and what they stop
Each connection carries its own safety mode, so a production database can be careful while a scratch one is not.
Guarded (the default):
- Statements that destroy or hand out access are refused outright:
DROP,TRUNCATE,ALTER,RENAME,GRANT,REVOKE - An
UPDATEorDELETEwith noWHEREis refused, because it would change every row - A write that touches many rows is not run straight away: the agent first reports exactly how many rows it would change and waits for you to agree
Unrestricted: anything the database user can do, the agent can do, with no second look. Use it only on a database you could lose without consequence.
Who is allowed to use it
Reading and writing are separate permissions, and both are off until someone grants them.
If your workspace uses custom roles, open Roles & Access and grant the Database capabilities to the roles that should have them. A useful split is to give everyone the read tools (list tables, describe a table, sample rows, run a query) and keep the write tool for a smaller group.
Until a role is granted those capabilities, the agent does not even see the tools and will honestly say it cannot do it.
Getting good answers
The agent works better when it can look before it writes:
- "What tables do we have?" - it lists them with rough row counts
- "Show me the orders table structure" - columns, types, keys and relationships
- "Show me a few rows from orders" - real examples, which is how it learns that your status column says
iptalrather thancancelled - "How many orders were cancelled last month?" - it writes the query and answers with the number
Ask for a number or a summary when that is what you want ("total revenue by month"), and the agent aggregates in the database instead of pulling thousands of rows back. Long lists are capped on purpose: an answer is not more true for being longer, and a huge result costs you tokens.
Getting the result as a spreadsheet
Ask for the file and you get one: "pull last month's orders and send it to me as Excel".
Behind the scenes the full result is written to a file and handed to the Data Export skill, which builds the spreadsheet and attaches it to the reply. The rows never travel through the conversation, so a 50,000-row export costs about the same as a short answer.
Data Export must be installed on the same agent for this. See Data Export.
When something does not work
"No database is configured" - the skill is installed but the connection details are empty, or the entry is missing a required field. Open Settings and complete it.
"Cannot reach the database" - your server did not answer in time. Usually a firewall: the connection has to be reachable from the internet.
"Access denied" - the username or password is wrong, or that user is not allowed to connect from outside. Check the grant.
The agent asks which database you mean - you have more than one connected and the question did not say. Name it ("in staging...") and it will go straight there. It never guesses, because a guess would eventually run a staging query against production.
The query took too long and stopped - queries are given a time limit so one heavy scan cannot stall everything. Narrow it with a date range or a WHERE and ask again.
