# Server Side Swift with Vapor – First 16 Chapters Now Available!

**URL:** <https://forums.kodeco.com/t/server-side-swift-with-vapor-first-16-chapters-now-available/42426>\
**Category:** 🎓 Courses & Articles\
**Created:** [May 9, 2018, 5:30pm UTC](https://forums.kodeco.com/t/server-side-swift-with-vapor-first-16-chapters-now-available/42426 "2018-05-09T17:30:58Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![crispy8888](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/crispy8888/32/75233_2.png) [@crispy8888](https://forums.kodeco.com/u/crispy8888)\
**Post date:** [May 9, 2018, 5:30pm UTC](https://forums.kodeco.com/t/server-side-swift-with-vapor-first-16-chapters-now-available/42426/1 "2018-05-09T17:30:58Z")

</div>

The first early access release of our Server Side Swift with Vapor book is now available!

* * *
 This is a companion discussion topic for the original entry at [https://www.raywenderlich.com/5230-server-side-swift-with-vapor-first-16-chapters-now-available](https://www.raywenderlich.com/5230-server-side-swift-with-vapor-first-16-chapters-now-available)

---

<div class="post-metadata">

**Author:** ![gazingatnavel](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/gazingatnavel/32/81494_2.png) [@gazingatnavel](https://forums.kodeco.com/u/gazingatnavel)\
**Post date:** [May 9, 2018, 10:46pm UTC](https://forums.kodeco.com/t/server-side-swift-with-vapor-first-16-chapters-now-available/42426/2 "2018-05-09T22:46:36Z")

</div>

Enjoying the book. Well done.

Ran into a small bump in _Chapter 6: Configuring a Database_ when attempting to connect to a MySQL database running in a Docker container on my host machine. (Caveat: I’m no expert on MySQL, or anything else for that matter…)

Apparently, the more recent versions of MySQL use a [default authentication plugin](http://mysqlserverteam.com/mysql-8-0-4-new-default-authentication-plugin-caching_sha2_password/) of `caching_sha2_password`, which the Vapor code in `MySQLConnection+Authenticate.swift` does not like. The only allowed authentication option in the Vapor code is `mysql_native_password`.

So, to make Vapor work with MySQL running in a Docker container just add a command-line option when you create the container. Add `--default-authentication-plugin=mysql_native_password` to the end of the Docker command that creates the container. As in:

`docker run --name mysql -e MYSQL_USER=vapor -e MYSQL_PASSWORD=password -e MYSQL_DATABASE=vapor -p 3306:3306 -d mysql/mysql-server --default-authentication-plugin=mysql_native_password`

I should probably add that this is with Vapor MySQL version 3.0.0-rc2.2. And the MySQL documentation for [`default-authentication-plugin`](https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_default_authentication_plugin).

---

<div class="post-metadata">

**Author:** ![0xtim](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/0xtim/32/111111_2.png) [@0xtim](https://forums.kodeco.com/u/0xtim)\
**Post date:** [May 10, 2018, 12:45pm UTC](https://forums.kodeco.com/t/server-side-swift-with-vapor-first-16-chapters-now-available/42426/3 "2018-05-10T12:45:32Z")

</div>

@gazingatnavel good spot. I’ve raised [an issue](https://github.com/vapor/mysql/issues/172) on GH for this. You can also specify an older version of MySQL as well if you want:

```bash
docker run --name mysql -e MYSQL_USER=vapor -e MYSQL_PASSWORD=password -e MYSQL_DATABASE=vapor -p 3306:3306 -d mysql/mysql-server:5.7

```

---

<div class="post-metadata">

**Author:** ![gazingatnavel](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/gazingatnavel/32/81494_2.png) [@gazingatnavel](https://forums.kodeco.com/u/gazingatnavel)\
**Post date:** [May 10, 2018, 12:58pm UTC](https://forums.kodeco.com/t/server-side-swift-with-vapor-first-16-chapters-now-available/42426/4 "2018-05-10T12:58:07Z")

</div>

@0xtim excellent point! I looked for something like that at the [MySQL Docker repository](https://hub.docker.com/_/mysql/), but for some reason it didn’t click with me. Looking at it again, there it is, staring me right in the face. Doh!

Thanks for raising the issue with the Vapor folks on GitHub.

And, OBTW, the Vapor MySQL code works just fine when deploying to Vapor Cloud. Perhaps they’re using an older version of MySQL or have the default authentication plugin set to mysql\_native\_password.

---

<div class="post-metadata">

**Author:** ![0xtim](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/0xtim/32/111111_2.png) [@0xtim](https://forums.kodeco.com/u/0xtim)\
**Post date:** [May 10, 2018, 1:10pm UTC](https://forums.kodeco.com/t/server-side-swift-with-vapor-first-16-chapters-now-available/42426/5 "2018-05-10T13:10:52Z")

</div>

Yeah I imagine they’ll hold back the MySQL release to something that works! 😅

---

<div class="post-metadata">

**Author:** ![simonqq](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/simonqq/32/83652_2.png) [@simonqq](https://forums.kodeco.com/u/simonqq)\
**Post date:** [May 10, 2018, 8:02pm UTC](https://forums.kodeco.com/t/server-side-swift-with-vapor-first-16-chapters-now-available/42426/6 "2018-05-10T20:02:13Z")

</div>

I hope the table of contents come back in the PDF version in the final release!

---

<div class="post-metadata">

**Author:** ![0xtim](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/0xtim/32/111111_2.png) [@0xtim](https://forums.kodeco.com/u/0xtim)\
**Post date:** [May 11, 2018, 11:54am UTC](https://forums.kodeco.com/t/server-side-swift-with-vapor-first-16-chapters-now-available/42426/7 "2018-05-11T11:54:48Z")

</div>

Yeah apparently the generation tool is borked, but being looked into!

---

<div class="post-metadata">

**Author:** ![skai](https://s3.amazonaws.com/cdn.raywenderlich.com/community/forum-assets/noun-game-ghost-878668.png) [@skai](https://forums.kodeco.com/u/skai)\
**Post date:** [May 13, 2018, 10:42am UTC](https://forums.kodeco.com/t/server-side-swift-with-vapor-first-16-chapters-now-available/42426/8 "2018-05-13T10:42:48Z")

</div>

Hey guys, will the book cover auth with ios app?

---

<div class="post-metadata">

**Author:** ![0xtim](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/0xtim/32/111111_2.png) [@0xtim](https://forums.kodeco.com/u/0xtim)\
**Post date:** [May 13, 2018, 12:23pm UTC](https://forums.kodeco.com/t/server-side-swift-with-vapor-first-16-chapters-now-available/42426/9 "2018-05-13T12:23:21Z")

</div>

@skai do you mean logging users in to the iOS and app sending authenticated requests to protected routes in the API? If so I’ve just finished the chapter that does just that!

---

<div class="post-metadata">

**Author:** ![skai](https://s3.amazonaws.com/cdn.raywenderlich.com/community/forum-assets/noun-game-ghost-878668.png) [@skai](https://forums.kodeco.com/u/skai)\
**Post date:** [May 14, 2018, 9:57pm UTC](https://forums.kodeco.com/t/server-side-swift-with-vapor-first-16-chapters-now-available/42426/10 "2018-05-14T21:57:26Z")

</div>

Yup! You mean something like registration and login? And is it basic auth or jwt/oauth thing?

---

<div class="post-metadata">

**Author:** ![0xtim](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/0xtim/32/111111_2.png) [@0xtim](https://forums.kodeco.com/u/0xtim)\
**Post date:** [May 15, 2018, 10:36am UTC](https://forums.kodeco.com/t/server-side-swift-with-vapor-first-16-chapters-now-available/42426/11 "2018-05-15T10:36:07Z")

</div>

It’s basic auth followed by bearer authentication with tokens
