- Home
- Integrations
- MySQL
MySQL and MariaDB integration: insert, find and update data
The MySQL integration in nana800 runs an SQL query against your MySQL or MariaDB database on every scheme run: it adds a lead, finds an order or changes a status. You only need the connection string from your hosting panel, and the block escapes values from other blocks, so a quote in a name cannot break the query. Each query costs $0.002, and your balance is topped up to $3.50 for free every month.
Build it in the builder- Block run: $0.002
- Free every month: $3.50
- No card needed
What you can do
- Add website leads, orders and bot messages as rows to your tables
- Look up data on request, such as an order by number or a customer by phone or email, and pass it further down the scheme
- Update and delete rows: mark an order as paid, change its status, remove outdated records
- Get the id of the row you just inserted into an AUTO_INCREMENT table and use it in the next blocks
- Put values from other blocks into the query with no SQL injection risk: the block escapes them itself
- Work with MySQL and MariaDB on AWS RDS, PlanetScale, Aiven, DigitalOcean or your own server, with or without SSL
Blocks in the builder
MySQL query
Action · $0.002 per run
Runs one SQL command against your MySQL or MariaDB database: SELECT, INSERT, UPDATE, DELETE and others. Returns the rows found, the number of affected rows, the id of a new row and an error text if the query fails.
How to set it up
- 1
Get access to the database
Copy the connection string from your hosting panel, like mysql://user:password@host:3306/dbname, or note the host, port, database name, user and password. The database must accept connections from the internet: the block refuses localhost and private network addresses like 192.168.x.x.
- 2
Create a scheme and add a trigger
Create a scheme in the builder and add the trigger that brings the data: a webhook for website leads, a message to a Telegram bot or a schedule. For the first test the button trigger is enough, it starts the scheme by hand.
- 3
Connect the MySQL block
Add the MySQL external database operation block. Paste the whole connection string or fill in the host, port, database name, user and password. The require SSL mode fits AWS RDS, PlanetScale, Aiven and most cloud databases. If your server has no SSL, choose disable.
- 4
Write the SQL query
In the SQL query field write one command, for example an insert into your leads table, and put fields from the trigger where the values go. Wrap text in quotes, numbers can go without them. If a table name comes from another block, wrap it in backticks.
- 5
Turn the scheme on and test it
Turn the scheme on, press the button trigger and open the block result: result holds the rows, row_count their number, insert_id the id of a new row, and error_text the database answer if something went wrong. When it works, keep the scheme on. While it is on, it costs $0.0042 per hour.
Frequently asked questions
Build your first scheme for free
Sign-up is free and needs no card. Every month the balance is topped up to $3.50 for free, enough for about 3,500 runs of basic blocks.
Build it in the builder