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

"Not supported" error #37

Closed
halvardssm opened this issue Apr 27, 2020 · 11 comments
Closed

"Not supported" error #37

halvardssm opened this issue Apr 27, 2020 · 11 comments

Comments

@halvardssm
Copy link
Contributor

Hi! I am trying to use this module in my application, but I receive an error "Not supported" whenever I try to connect. I shouldn't have any options which would cause the issue, but am I doing something wrong? Also, if it has anything to say, I am using the docker image of mysql:latest for the db, and Deno 0.41.0

Here is my code:

import { Client, ClientConfig } from "https://deno.land/x/mysql/mod.ts";

const config: ClientConfig = {
	hostname: "localhost",
	port: 5001,
	username: "root",
	password: "pwd",
	db: "test",
	debug: true
}

const client = await new Client().connect(config);

console.log(await client.query("select 1 from nessie_migrations limit 1;"))

And here is the error:

$ deno run --allow-net --allow-read test.ts
Compile file:///Users/halvardssm/dev/mix/deno-nessie/test.ts
INFO connecting localhost:5001
error: Uncaught Error: Not supported
► auth.ts:43:13

43       throw new Error("Not supported");
               ^

    at auth (auth.ts:43:13)
    at buildAuth (auth.ts:42:24)
    at Connection._connect (connection.ts:53:18)
    at async Connection.connect (connection.ts:82:5)
    at async Client.createConnection (client.ts:45:5)
    at async DeferredStack.pop (deferred.ts:33:20)
    at async Client.useConnection (client.ts:109:24)
    at async Client.query (client.ts:89:12)
    at async test.ts:14:13
@halvardssm
Copy link
Contributor Author

Ok, so I figured out that the reason for this is that I am using MySQL 8. What exactly needs to be done to support MySQL 8? Anything I can help you with?

@manyuanrong
Copy link
Member

#16
The default authentication plug-in for 8.0 has not yet been implemented. If you want to use it now, you need to turn off authentication and use a blank password to access

@halvardssm
Copy link
Contributor Author

Ok, thanks! Will add that to my readme 💪

@danbulant
Copy link

If you want to use it now, you need to turn off authentication and use a blank password to access

A better way is to use the old version which is still present, you just need to use mysql_native_password. A simple query to update:

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '<password>';

@Tellus
Copy link

Tellus commented Jun 30, 2020

If you want to use it now, you need to turn off authentication and use a blank password to access

A better way is to use the old version which is still present, you just need to use mysql_native_password. A simple query to update:

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '<password>';

I didn't have much luck with that approach, but changing the MySQL configuration itself worked just fine.

In the [mysqld] section of my MySQL configuration file I added

default_authentication_plugin=mysql_native_password

@manyuanrong, I think this solution might be slightly better than blank passwords, yes?

@KaKi87
Copy link

KaKi87 commented Oct 26, 2020

Hello, any news on supporting caching_sha2_password ? Thanks.

@KaKi87
Copy link

KaKi87 commented Nov 27, 2020

@manyuanrong, please ? :)

@BayoKwendo
Copy link

Was this fixed. i cant seem to connect to mysql 8

@KaKi87
Copy link

KaKi87 commented Feb 17, 2022

Hello, still no news ? Thanks

@Lukas424242
Copy link

I have actually the exact same Problem with my project.

@lideming
Copy link
Collaborator

Should be fixed by #137 and #68.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants