Perfect-MySQL icon indicating copy to clipboard operation
Perfect-MySQL copied to clipboard

Google Cloud (MySql)

Open priore opened this issue 7 years ago • 0 comments

how can I use MySQLDatabaseConfiguration to connect to a Google Cloud that requesting certificates?

I used it to connect to a local database, but I don't understand how I can connect to a Google remote databases that required the certificates?

I already have the certificates but I don't understand how to configure connection with Perfect to use them.

below the standard example without certificates:

    do {
        let config = try MySQLDatabaseConfiguration(database: "MYDB", host: "localhost", port: 3306, username: "root", password: "root123")
        let db = Database(configuration: config)
        let tblUser = db.table(User.self)
        let query = try? tblUser.select()
        print(query)
    } catch  {
        print(error)
    }

Thanks.

priore avatar Apr 26 '18 16:04 priore