- Databases
- MySQL
MySQL
Lade officially supports deploying MySQL databases.
Supported Versions
The following MySQL versions are supported and receive security updates:
- 9.1
- 8.4
- 8.0
Provisioning MySQL
A MySQL addon can be provisioned with the CLI:
$ lade addons create mysql --name mydb
You will be prompted to select an available plan, region, and version.
Attaching to Your App
Your MySQL addon can be attached to your app with the CLI:
$ lade addons attach mydb --app myapp
When your addon is attached, the DATABASE_URL
and MYSQL_URL
environment variables will be added to your app.
You can confirm these environment variables were added to your app with the lade env list
command.
Accessing Your Database
To access your database remotely, you will need to enable public access on your addon. You can view settings with the lade addons show
command. The addon URI will follow the format:
mysql://<user>:<password>@<host>:<port>/<dbname>
You can access your remote database with the mysql
command:
$ mysql -u <user> -p<password> -h <host> -P <port> <dbname>
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 9.1 MySQL Community Server - GPL
Copyright (c) 2000, 2021, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>