MySQL

MySQL is supported via the dokku-mysql plugin. Provisioning, linking, dumps, and restores follow the same shape as Postgres — most of the Postgres docs apply directly.

Provisioning

$ ssh dokku@<stack-ip> mysql:create mysql-<app>
$ ssh dokku@<stack-ip> mysql:link mysql-<app> <app>

Or, on apps with needs_mysql: true, OwnStack auto-creates and links on first deploy. Linking sets DATABASE_URL to a mysql://… connection string.

The DATABASE_URL shape

mysql://mysql:<password>@dokku-mysql-<service>:3306/<dbname>

Connect

$ ssh dokku@<stack-ip> mysql:connect mysql-<app>

Dump & restore

ownstack db dump auto-detects MySQL apps. The output is gzipped mysqldump SQL:

$ ownstack db dump --app=<app> --output=backup.sql.gz
$ gunzip < backup.sql.gz | mysql my_local

Restore back to a stack with ownstack db restore --url=... — same flow as Postgres restore. See Postgres restore for details.

Differences from Postgres

PostgresMySQL
Custom-format dump (.dump)Plain SQL gzipped (.sql.gz)
Default port 5432Default port 3306
User postgresUser mysql
postgres:connectmysql:connect
db repair for password driftdb repair works the same; root password drift after import is rarer with mysqldump than with pg_dumpall