Databases
Create and connect a database
Create PostgreSQL or MySQL safely, connect an application and verify imports, credentials and backups.
Before you start
- Know whether the application supports PostgreSQL, MySQL or both.
- Have the required schema, migration commands or an export file ready.
- Know which application and environment will use the database.
- For imports, confirm the export engine and format match the selected database engine.
Create a standalone database or create one while deploying an application.
Create DatabaseDeploy Application1. Choose the correct engine
Use the engine required by the application and its libraries. PostgreSQL and MySQL are not interchangeable dump formats. Source detection may suggest an engine from manifests and environment examples, but the repository documentation remains authoritative.
2. Create names and credentials
- 1Choose PostgreSQL or MySQL and an available version.
- 2Enter the editable portion of the database name. Ghost Deploy adds the workspace prefix automatically.
- 3Create a restricted database user or select an existing workspace database user.
- 4Generate a strong password, copy it into the application's environment values and store it in an approved secret manager.
- 5Wait for the database status to become Active before importing data or starting the application.
3. Connect the application
Use the Environment editor to fill separate host, port, database, username and password keys, or generate a connection URL when the application expects one value. Never use the management endpoint shown for external administration as an internal application hostname unless the guide explicitly says so.
4. Import or migrate data
- 1Open the database and choose Import / Export.
- 2Select the format that matches the file. Plain SQL and native archive formats use different restore tools.
- 3Keep compatibility adjustments enabled for third-party exports unless you need strict failure behaviour.
- 4Review every reported compatibility adjustment. Ghost Deploy changes only a temporary import copy.
- 5After completion, open Tables and verify important tables and representative rows.
If something does not work
- Connection refused or timed out: confirm the correct host, port and network context.
- Authentication failed: re-copy the database name, restricted username and password; invisible spaces are common.
- Import says the archive is invalid: verify whether the file is plain SQL, a custom PostgreSQL archive or a compressed file before retrying.
- Server-version mismatch during backup: use a dump client matching or newer than the database server major version.
- Migration fails after deployment: open the deployment log, fix the first migration error and use a safety backup before retrying destructive changes.