Kitura / Kitura/SwiftKueryMySQL
MySQLConnection not working
- Dominant language
- Swift
- Stars
- 34
- Forks
- 13
- PR merge metrics
- No merged PRs in 30d
Description
So problem is that I can't connect to my database in docket container. I've tested connection with Workbench and in python and everything was working, but not in swift 😭
**My docket-compose file**
```yaml
version: '3.3'
services:
byTickets-database:
image: mysql:latest
volumes:
- "./.mysql-data/db:/var/lib/mysql"
environment:
MYSQL_DATABASE: byTickets
MYSQL_ROOT_PASSWORD: root
ports:
- "3308:3306"
```
**My connection code**
```swift
let connection = MySQLConnection(
host: "127.0.0.1",
user: "root",
password: "root",
port: 3308,
reconnect: true
)
connection.connect() { res in
guard res.success else {
print(res.asError?.localizedDescription as Any)
return
}
connection.execute("SELECT @@version") { res in
print(res)
}
}
```
**Error**
```
"The operation couldn’t be completed. (SwiftKuery.QueryError error 0.)"
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.