MySQL

Connecting to MySQL

Enclave MySQL Databases require authentication and SSL to connect.

Connecting with SSL

Note

If you get the following error, you’re probably not connecting over SSL:

ERROR 1045 (28000): Access denied for user 'aptible'@'ip-[IP_ADDRESS].ec2.internal' (using password: YES)

Some tools may require additional configuration to connect with SSL to MySQL:

  • When connecting via the mysql command line client, add this option: --ssl-cipher=DHE-RSA-AES256-SHA.
  • When connecting via JetBrains DataGrip (through aptible db:tunnel), you’ll need to set useSSL to true and verifyServerCertificate to false in the Advanced settings tab for the data source.

Tip

If you are using PHP, we have sample code to connect over SSL here: Connecting to MySQL on Enclave using PHP.

Connecting without SSL

Warning

Never transmit sensitive or regulated information without SSL. Connecting without SSL should only be done for troubleshooting or debugging.

For debugging purposes, you can connect to MySQL without SSL using the aptible-nossl user. As the name implies, this user does not require SSL to connect.

Connecting as root

If needed, you can connect as root to your MySQL database. The username for root is the same as that of the aptible user.

Replication

Master-slave replication is available for MySQL.

Creating More Databases

Enclave provides you with full access to a MySQL instance. If you’d like to add more databases, you can do so by Connecting as root, then using SQL to create the database:

/* Substitute NAME for the actual name you'd like to use */
CREATE DATABASE NAME;
GRANT ALL ON NAME.* to 'aptible'@'%';