Connect to Your CodeRed Database¶
CodeRed MariaDB or PostgreSQL databases are designed to be used directly by your website. However, they can be connected to externally using standard MariaDB/MySQL or PostgreSQL clients.
Step 1: Install a Client¶
This guide will use the official
mysql client shipped with MariaDB and
psql command shipped with PostgreSQL. If you do not have these installed,
They can be installed from the following links, or from your system’s package
manager. For best results, ensure the version installed is equal to or higher
than the version of your CodeRed database.
During installation, the server component is not required, only the client tools.
Step 2: Obtain Your CodeRed Database Credentials¶
From the CodeRed Dashboard, select your website and then select the Database tab. This will provide the connection info. To retrieve the password, click the Show Production/Staging password button.
For enhanced security, database passwords are automatically rotated every time your app is deployed. This password is therefore temporary and should never be stored or used in code.
Step 3: Connect to the Database via Command Line¶
The CodeRed Dashboard Database tab also provides a command line snippet which can be copy/pasted to connect directly to your database. Enter the password from Step 2 above when prompted.