SourceLair’s MySQL capabilities

SourceLair MySQL database is a fully functional MySQL server. You can connect to it from your SourceLair project like you would with any other server of yours. The only difference is that it shares networking only with your project’s processes, making it visible to your web server and terminal, but invisible to everyone else.

Database information:

Version: 5.7
Host: mysql
User: root
Password: mysecretpassword

Accessing your database serve

You can connect to your database from your SourceLair Terminal using:

mysql -h mysql -u root -pmysecretpassword

After connecting to your database from the Terminal, you can change the default password anytime you want by running:

SET PASSWORD FOR root = PASSWORD('mypass');

where 'mypass' is your desired new password.

Accessing your database

SourceLair creates a database named “sourcelair” by default and makes sure it exposes the URL for accessing your database in the DATABASE_URL=mysql://root:mysecretpassword@mysql:3306/sourcelair environment variable. This allows you to use libraries like Django Database URL or parse-database-url to connect to the correct database in each environment - ie SourceLair and Heroku. If you’d like to change the default settings, like change your password or rename the database, you can always change your project’s environment using a .env file.

For any further information or inquiries feel free to contact support@sourcelair.com