Database access
Browse and edit tables in the dashboard, run SQL, open phpMyAdmin in one click, show credentials, reset the password, check and repair tables, and import SQL.
This article is a draft and may change.
The Database tab lets you work with an environment's MariaDB database without a separate tool or a download: browse tables, edit rows, and run SQL. phpMyAdmin is one click away when you want it.
Open it
- Open a site and pick the environment in the top bar.
- Choose Database.
- Read the warning, then choose Open database.
Changing a database directly can break a site. On live, try the change on staging first. Tick Don't show me this warning again to go straight to the tables next time. That choice stays in this browser only.
Browse tables
The left panel lists every table. Search it, refresh it, or choose + to start a new table in the SQL console. Pick a table to see its rows.
- Columns show their type under the name. A key icon marks the primary key.
- Filter narrows rows (equals, contains, starts with, is NULL, and more). Sort orders them by one or more columns. Selecting a column name sorts by it.
- Columns hides the columns you do not need.
- The pager shows which rows you see, such as 1 - 50 of 1,234. The ... menu changes the page size, exports the view as CSV (up to 10,000 rows), and copies the page.
- Long values are cut at 1,000 characters. Open a cell to see all of it, up to 1 MB. JSON is shown formatted, and you can copy the value.
Edit rows
Double-click a cell, or select it and press Enter, to edit it. Long text opens in a larger editor. Add record adds a new row at the top. Select rows and choose Delete to mark them.
Nothing changes until you choose Save changes. All the changes go in one job, and the job is written to User activity with the table name and the counts, never the values.
- On live, Avaloi asks you to confirm before it saves.
- Deleting rows always asks first.
- A table with no primary or unique key can only be read here, because Avaloi cannot tell one row from another. Use the SQL console or phpMyAdmin.
Schema
Schema shows every table with its rows, size, and engine. Pick a table to see its columns, types, defaults, indexes, and foreign keys.
SQL console
Write one statement and choose Run (or press Ctrl+Enter).
- Reads (
SELECT,SHOW,DESCRIBE,EXPLAIN) run straight away, in a read-only transaction, and return up to 1,000 rows. - A statement that changes data needs Allow changes turned on. On staging it starts on. On live it starts off, and turning it on asks you to confirm.
- Each statement stops after a few seconds. Add a
WHEREclause or aLIMITto large queries. - History keeps your last statements in this browser. Copy results copies the rows as tab separated text for a spreadsheet.
Database access menu
- Open phpMyAdmin signs you in to phpMyAdmin in a new tab, for this site's database only. Each link works once and expires after 60 seconds. The phpMyAdmin session then lasts up to four hours, or 30 minutes without use. Choose it again for a new link.
- Show credentials shows the host, port, database name, and user. Showing the password asks you to confirm your account password first, and the reveal is written to User activity. Copy the SSH tunnel command to connect with your own client.
- Reset database password sets a new password and updates
wp-config.phpat the same time, so the site keeps working. - Import a SQL file takes a
.sqlor.sql.gzfile up to 1 GB. You confirm by typing the database name. Take a backup first if the import matters. - Check and repair tables scans tables for damage and repairs what it finds.
Limits
- Grid pages: up to 500 rows. CSV export: up to 10,000 rows.
- SQL console: one statement at a time, up to 1,000 rows back, a few seconds per statement.
- Row changes: up to 100 in one save.
- phpMyAdmin links: work once and expire after 60 seconds.
- SQL imports: up to 1 GB.
Quick answers
phpMyAdmin says to open it from Avaloi. The link was used, it expired, or the session ended. Choose Open phpMyAdmin again.
Why can't I edit this table? It has no primary or unique key, or it is a view. Change it with the SQL console or phpMyAdmin.
Can my AI assistant read the database?
Yes, through the query_database tool of the Avaloi MCP server. It can only read. Changes stay with people in this tab.
Does editing live break the rule that live is read only? No. Live code is read only. Database content can change, and Avaloi asks you to confirm each change on live.
API
GET /v1/environments/{id}/databaseGET /v1/environments/{id}/database/tablesGET /v1/environments/{id}/database/tables/{table}POST /v1/environments/{id}/database/tables/{table}/rows/queryPOST /v1/environments/{id}/database/tables/{table}/rows/cellPOST /v1/environments/{id}/database/tables/{table}/rows/exportPOST /v1/environments/{id}/database/tables/{table}/rows(live needsconfirm: true)POST /v1/environments/{id}/database/queryPOST /v1/environments/{id}/database/execute(live needsconfirm: true)POST /v1/environments/{id}/database/phpmyadmin-sessionGET /v1/environments/{id}/credentials/databasePOST /v1/environments/{id}/credentials/rotatePOST /v1/environments/{id}/database/checkPOST /v1/environments/{id}/database/import
Related
Still stuck?
Email [email protected] with your site name and what you tried, or send us a message.