Skip to content

Database Connections

The database connection is defined in ~/admin/includes/config.php. The installer writes this file, but you can edit it afterwards to change credentials, point at a different server, or enable an encrypted connection.

Connection Settings

ConstantPurpose
SENDSTUDIO_DATABASE_TYPEDatabase engine. mysql.
SENDSTUDIO_DATABASE_HOSTHostname or IP of the database server. Append a custom port here (see below).
SENDSTUDIO_DATABASE_NAMEDatabase name.
SENDSTUDIO_DATABASE_USERDatabase user.
SENDSTUDIO_DATABASE_PASSPassword for that user.
SENDSTUDIO_DATABASE_UTF8PATCHCharacter set handling for the connection.
SENDSTUDIO_DATABASE_SQLMODESQL mode applied to the session.
SENDSTUDIO_DATABASE_DISABLE_FOREIGNKEYCHECKSDisables foreign key checks. Leave at the installed value unless support advises otherwise.
SENDSTUDIO_DATABASE_TLSSet to '1' to encrypt the connection. See Encrypting the Connection.
SENDSTUDIO_DATABASE_TLS_KEYAbsolute path to the client private key.
SENDSTUDIO_DATABASE_TLS_CERTAbsolute path to the client certificate.
SENDSTUDIO_DATABASE_TLS_CAAbsolute path to the CA certificate that validates the server.

Changing Database Credentials

If you rotate the database password or move to a different database user, edit the matching constants in ~/admin/includes/config.php:

define('SENDSTUDIO_DATABASE_USER', 'interspire_user');
define('SENDSTUDIO_DATABASE_PASS', 'new-password-here');

No upgrade step or cache clear is required — the next request uses the new details.

Using a Custom Port

There is no separate port constant. Append the port to the host value:

define('SENDSTUDIO_DATABASE_HOST', 'db.example.com:3307');

Encrypting the Connection v8.5.2

Interspire Email Marketer can connect to MySQL over TLS/SSL. This matters when the database is on a separate host, since an unencrypted connection carries subscriber data and credentials across the network in the clear.

Enabling TLS requires certificates on both sides: the MySQL server must be configured to accept encrypted connections, and Interspire Email Marketer needs a client key, client certificate, and the CA certificate that validates the server.

Configuring TLS During Installation

On a new installation, check TLS Configuration (Optional) on the MySQL Database Details screen of the installation wizard and enter the full paths to the client key, client certificate, and CA certificate. The installer opens an encrypted connection and writes the constants for you.

Configuring TLS After Installation

On an existing installation, add the constants to ~/admin/includes/config.php:

define('SENDSTUDIO_DATABASE_TLS', '1');
define('SENDSTUDIO_DATABASE_TLS_KEY', '/opt/interspire/ssl/client.key');
define('SENDSTUDIO_DATABASE_TLS_CERT', '/opt/interspire/ssl/client.crt');
define('SENDSTUDIO_DATABASE_TLS_CA', '/etc/mysql/ssl/ca.crt');

SENDSTUDIO_DATABASE_TLS must be set to '1'. When it is absent, TLS defaults to off and the other three values are ignored.

Store certificate files outside the web server document root, and make them readable only by the web server user (commonly www-data). Use absolute paths, not relative ones.

Verifying the Connection

Go to Tools > System Information. Two entries near the end of the page report the state of the database connection:

  • Database SSL Configured — whether SENDSTUDIO_DATABASE_TLS is enabled.
  • Database SSL Active — whether the live connection is actually encrypted. When it is, this also reports the cipher, the protocol version, and whether the certificate is self-signed.

“Configured: Yes” with “Active: No” means the setting is on but the connection is not encrypted — most often the localhost socket issue above.

For server-side setup — generating certificates, editing my.cnf, enforcing REQUIRE SSL per user, and the differences between MySQL, MariaDB, and Amazon RDS — see How to Secure MySQL Connections in Interspire with TLS/SSL.

Troubleshooting

SymptomCauseFix
System Information shows SSL configured but not activeHost is localhost, so the connection uses a local socketChange the host to 127.0.0.1 or a resolvable hostname
Connection fails after enabling TLSCertificate files unreadable by the web server user, or relative paths usedGrant read access to the web server user and use absolute paths
Connection fails before TLS is configured in the applicationREQUIRE SSL was granted on the database user firstConfigure TLS in config.php before enforcing the grant, or temporarily remove the requirement
Application will not load after editing config.phpMalformed constant or missing semicolonRestore the backup and re-apply the change