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
| Postgres | MySQL |
|---|---|
Custom-format dump (.dump) | Plain SQL gzipped (.sql.gz) |
| Default port 5432 | Default port 3306 |
User postgres | User mysql |
postgres:connect | mysql:connect |
db repair for password drift | db repair works the same; root password drift after import is rarer with mysqldump than with pg_dumpall |
Read next
- Postgres dumps — same flow, mostly applies.
ownstack dbreference