Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fatal error: Error raised at top level: ⚠️ MySQL Error: Unsupported auth plugin: caching_sha2_password #110

Closed
TofPlay opened this issue May 15, 2018 · 7 comments
Assignees
Labels
enhancement New feature or request
Projects
Milestone

Comments

@TofPlay
Copy link

TofPlay commented May 15, 2018

Hi,
I just change my database to MySQL and when I run my app Xcode stop and display this error:
image
My package.swit:

// swift-tools-version:4.0
import PackageDescription

let package = Package(
    name: "MyApp",
    dependencies: [
        .package(url: "https://github.com/vapor/vapor.git", from: "3.0.0"),
        .package(url: "https://github.com/vapor/fluent-mysql.git", from: "3.0.0-rc"),
    ],
    targets: [
        .target(name: "App", dependencies: ["FluentMySQL", "Vapor"]),
        .target(name: "Run", dependencies: ["App"]),
        .testTarget(name: "AppTests", dependencies: ["App"])
    ]
)

MySQL launched with Docker:

docker run --name mysql -e MYSQL_USER=vapor  -e MYSQL_PASSWORD=password -e MYSQL_DATABASE=vapor  -p 3306:3306 -d mysql/mysql-server
@0xTim
Copy link
Member

0xTim commented May 15, 2018

@TofPlay it's a bug in Vapor's MySQL due to a breaking change in MySQL 10.something. For now you can do

docker stop mysql
docker rm mysql
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

The underlying issue is raised at vapor/mysql-kit#172

@TofPlay
Copy link
Author

TofPlay commented May 16, 2018

Ok thanks @0xTim 🙂

@tanner0101 tanner0101 added the enhancement New feature or request label Jun 14, 2018
@tanner0101 tanner0101 added this to the 3.0.0 milestone Jun 14, 2018
@tanner0101 tanner0101 self-assigned this Jun 14, 2018
@tanner0101
Copy link
Member

vapor/mysql-kit#172 has been closed. This will be fixed as a part of the 3.0.0 tag.

@ampedNinja
Copy link

This is fixed in 3.0.0? I'm still seeing this issue.....

@captainbarbosa
Copy link

This error is still persisting for me when starting a new project with Vapor 3.1.10 and attempting to configure FluentMySQL.

vapor/mysql-kit#172 seems like the related issue but I'm unsure if it was resolved. Additional clarification would be most appreciated.

@smathieu
Copy link

We're also facing this using MySQL 5.7. We connect to MySQL via sidecar proxy which handles authentication for us, so we can't easily just add a password.

@GuimaraesGabrielG
Copy link

GuimaraesGabrielG commented Apr 17, 2020

I also had this problem, but with some research on the net I managed to solve

Solution:

I'm using Xcode Version 11.3.1 and mySql: mysql 8.0.19 and Vapor 3.1.10

let mysqlConfig = MySQLDatabaseConfig( hostname: "127.0.0.1", port: 3306, username: "root", password: "****", database: "chatter", transport: MySQLTransportConfig.unverifiedTLS )

let mysql = MySQLDatabase(config: mysqlConfig)

OBS: this setting can differentiate. e.g: database, password(change in mysql)

and hostname: "127.0.0.1",
port: 3306,
username: "root",

in the class MySQLDatabaseConfig you can see if these are the information
public static func root(database: String) -> MySQLDatabaseConfig { return .init(hostname: "127.0.0.1", port: 3306, username: "root", database: database) }

Hope this helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
No open projects
Vapor 3
  
Awaiting triage
Development

No branches or pull requests

7 participants