Skip to main content
A managed MySQL instance that only accepts TLS connections, with a user that can manage its own databases, users, routines and events. Facts shared by every engine (limits, snapshots, Insights) are on the Databases overview.

Connect

Copy the connection URL from the database’s page in the dashboard. It has this shape, with the squarecloud user and the squarecloud database created for you:
MySQL requires SSL/TLS; a client certificate is not needed. Use 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.
The server does not resolve host names: when you create users, their host part is an IP address or '%'. 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 with Too 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

The squarecloud@'%' 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 INFILE and SELECT ... INTO OUTFILE;
  • FLUSH PRIVILEGES, which answers ERROR 1227. It is not needed: GRANT, CREATE USER and ALTER USER apply at once;
  • SHOW ENGINE INNODB STATUS;
  • replication.

Importing a dump

Dumps taken from another server often carry DEFINER=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_size keeps 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_packet is 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 the mysql.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 own LOCK 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.

Contact us

If you continue facing technical difficulties, our specialized support team is available to assist you. Contact us and we’ll be happy to help you resolve any issue: support quality is a big part of why developers rate Square Cloud 4.9/5 across 402 reviews on Google and Trustpilot.