Connect
Copy the connection URL from the database’s page in the dashboard. It has this shape, with thesquarecloud user and the squarecloud database created for you:
ssl-mode=REQUIRED, or VERIFY_CA with the .pem from Connection → SSL/TLS certificate as the CA to also check the server.
The server accepts only the caching_sha2_password authentication. Older drivers that lack it, such as the npm mysql package, fail to log in: use mysql2 on Node.js or a current connector.
- Node.js
- Python
- mysql CLI
'%'.
ORMs and GUI tools (Prisma, MySQL Workbench, DBeaver, HeidiSQL) are covered in database connection errors.
Connections
Each database accepts up to 256 simultaneous connections; past that, new ones fail withToo many connections. Create one pool per process at startup and reuse it, sized so that every app, worker and shard together stays under the limit. The Insights tab shows who holds the open connections.
Your user and permissions
Thesquarecloud@'%' user has every privilege, with GRANT OPTION, except the administrative ones. You can create databases, users and grants, routines, triggers and events, and change global variables with SET GLOBAL and SET PERSIST.
What the administrative privileges would allow is not available:
- server-side files:
LOAD DATA INFILEandSELECT ... INTO OUTFILE; FLUSH PRIVILEGES, which answersERROR 1227. It is not needed:GRANT,CREATE USERandALTER USERapply at once;SHOW ENGINE INNODB STATUS;- replication.
Importing a dump
Dumps taken from another server often carryDEFINER=root@localhost (or another administrative account) on views, routines, triggers and events. Importing them fails with ERROR 1227 (42000): Access denied; you need (at least one of) the ... privilege(s). Remove the clauses before importing, or set them to your own user:
Configuration
- No binary log. Replication, change data capture (Debezium and similar) and point-in-time recovery are not available.
- Buffer pool:
innodb_buffer_pool_sizekeeps MySQL’s default of 128 MB; it does not grow with the database’s RAM. You can raise it within the RAM you allocated, leaving room for connections and the server itself (about half of the RAM is a safe start):A persisted value is lost when the database is restored from a snapshot or upgraded: set it again afterwards. max_allowed_packetis 64 MB, the largest single statement or row the server accepts.- The rest of the server configuration is the same on every database.
Slow queries
The Insights tab lists statements by mean time (any statement with a run of 100 ms or more). For the raw slow query log, turn it on: it is written to themysql.slow_log table at the same 100 ms threshold, never expires and uses the database’s storage, so empty it when you are done:
Snapshots
A MySQL snapshot holds your schemas, routines, triggers, events and users, exported in a single transaction: consistent for InnoDB tables, not guaranteed for MyISAM. Besides the general cases, it fails when your ownLOCK TABLES blocks it for more than 5 minutes. The export is plain SQL text, so a database close to its 10 GB of storage may not fit in a snapshot.
Common errors
After a forced stop, MySQL runs its crash recovery on the next start, which takes longer on large databases: wait for it to finish.

