POST /v1/databases/create.
What each type needs
username: 3 to 32 letters, numbers or_, starting with a letter. Names reserved by the database, such asrootoradmin, are refused.database: up to 63 letters, numbers or_, starting with a letter.memoryMB: a JSON number (not a string), at least 512 MB by default, and it must fit in the memory left on your plan.name: letters, numbers, spaces,_,.and-, starting with a letter or a number.
Create it
Creating, changing and deleting databases share one limit of 1 request every 3 seconds. Starting, stopping and restarting share another, of 10 requests per minute. See the limits.
Wait until it is ready
The database starts ascreating. Read it with GET /v1/databases/{databaseId} until it is active; only then does connection hold the address to use.
Connect your application
connection has the host and port to use, plus the username and the database. With the password you stored, the connection string is:
Put the string in an environment variable of the application instead of in the code, and restart the application to apply it.
A password with characters such as
@, : or / breaks the connection string unless it is URL encoded. Prefer a long password made of letters and numbers.Changing it
- Name or memory:
PUT /v1/databases/{databaseId}. A memory change only applies the next time the database is started, stopped or restarted, andrestartRequiredistrueuntil then. - Password:
POST /v1/databases/{databaseId}/update-credentials. Applications that use the old password stop connecting until you update them. - Power:
start,stopandrestart. - Delete:
DELETE /v1/databases/{databaseId}removes the database and its data. There is no way to undo it.