From ad005b6b1bd1c41a657ec89ea67b1a0d5d59541e Mon Sep 17 00:00:00 2001 From: Matthias Ludwig Date: Wed, 18 Oct 2017 15:01:07 +0200 Subject: [PATCH] install introduction cmysql ubuntu --- 2.0/docs/mysql/package.md | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/2.0/docs/mysql/package.md b/2.0/docs/mysql/package.md index 71da59e6..f4bbde99 100644 --- a/2.0/docs/mysql/package.md +++ b/2.0/docs/mysql/package.md @@ -4,15 +4,26 @@ This section outlines how to import the MySQL package both with or without a Vap ## Install MySQL -To use MySQL, you need to have the C MySQL library installed on your computer. +To use MySQL, you need to have the C MySQL library installed on your computer. ```sh +# macOS + brew install vapor/tap/cmysql ``` +> Note for Ubuntu +> * [Add Vapor's APT repo to get access to all of Vapor's system packages.](https://docs.vapor.codes/2.0/getting-started/install-on-ubuntu/#apt-repo) + +```sh +# Ubuntu + +sudo apt-get install cmysql +``` + ## With Vapor + Fluent -The easiest way to use MySQL with Vapor is to include the MySQL provider. +The easiest way to use MySQL with Vapor is to include the MySQL provider. ```swift import PackageDescription @@ -27,9 +38,9 @@ let package = Package( ) ``` -The MySQL provider package adds MySQL to your project and adds some additional, Vapor-specific conveniences like `drop.mysql()`. +The MySQL provider package adds MySQL to your project and adds some additional, Vapor-specific conveniences like `drop.mysql()`. -Using `import MySQLProvider` will import both Fluent and Fluent's Vapor-specific APIs. +Using `import MySQLProvider` will import both Fluent and Fluent's Vapor-specific APIs. ## With Fluent @@ -49,7 +60,7 @@ let package = Package( ) ``` -Use `import MySQLDriver` to access the `MySQLDriver` class which you can use to initialize a Fluent `Database`. +Use `import MySQLDriver` to access the `MySQLDriver` class which you can use to initialize a Fluent `Database`. ## Just MySQL @@ -68,4 +79,4 @@ let package = Package( ) ``` -Use `import MySQL` to access the `MySQL.Database` class. \ No newline at end of file +Use `import MySQL` to access the `MySQL.Database` class.