Errata chapter 6

Pg 109

the constructor for MySQLDatabaseConfig requires a port number so instead of:

let databaseConfig = MySQLDatabaseConfig(
hostname: “localhost”,
username: “vapor”,
password: “password”,
database: “vapor”)

it should be:

let databaseConfig = MySQLDatabaseConfig(
hostname: “localhost”,
port: 3306,
username: “vapor”,
password: “password”,
database: “vapor”)

Otherwise it doesn’t compile.

Hi @hammerhead you shouldn’t need the port, it should have a default value, a la https://github.com/vapor/mysql/blob/master/Sources/MySQL/Database/MySQLDatabaseConfig.swift#L35

If you run swift package update, regenerate the project and try again does it still happen?