2015-07-10 08:33:31 +00:00
|
|
|
> **NOTE** the mysql driver is disable until driver issue [#257](https://github.com/go-sql-driver/mysql/issues/257) is resolved
|
|
|
|
|
|
|
|
# MySQL
|
|
|
|
|
2015-08-19 04:57:35 +00:00
|
|
|
Drone comes with support for MySQL as an alternate database engine. To enable MySQL, you should specify the following environment variables:
|
2015-07-10 08:33:31 +00:00
|
|
|
|
2015-08-09 03:51:12 +00:00
|
|
|
```bash
|
2015-08-04 05:46:58 +00:00
|
|
|
DATABASE_DRIVER="mysql"
|
2015-08-09 03:51:12 +00:00
|
|
|
DATABASE_CONFIG="root:pa55word@tcp(localhost:3306)/drone"
|
2015-07-10 08:33:31 +00:00
|
|
|
```
|
|
|
|
|
2015-08-09 03:51:12 +00:00
|
|
|
## MySQL configuration
|
2015-07-10 08:33:31 +00:00
|
|
|
|
|
|
|
The following is the standard URI connection scheme:
|
|
|
|
|
|
|
|
```
|
|
|
|
[username[:password]@][protocol[(address)]]/dbname[?options]
|
|
|
|
```
|
|
|
|
|
|
|
|
The components of this string are:
|
|
|
|
|
|
|
|
* `username` optional. Use this username when connecting to the MySQL instance.
|
|
|
|
* `password` optional. Use this password when connecting to the MySQL instance.
|
|
|
|
* `protocol` server protocol to connect with.
|
|
|
|
* `address` server address to connect to.
|
|
|
|
* `dbname` name of the database to connect to
|
|
|
|
* `?options` connection specific options
|
|
|
|
|
|
|
|
This is an example connection string:
|
|
|
|
|
|
|
|
```
|
2015-08-09 03:51:12 +00:00
|
|
|
root:pa55word@tcp(localhost:3306)/drone
|
2015-07-10 08:33:31 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
## MySQL options
|
|
|
|
|
|
|
|
See the official [driver documentation](https://github.com/go-sql-driver/mysql#parameters) for a full list of driver options.
|
2015-08-24 21:10:30 +00:00
|
|
|
|
|
|
|
|
|
|
|
## MySQL Database
|
|
|
|
|
|
|
|
Drone does not automatically create the database. You should use the command line utility or your preferred management console to create the database:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
mysql -P 3306 --protocol=tcp -u root -e 'create database if not exists drone;'
|
|
|
|
```
|