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

"Client does not support authentication protocol requested by server" #744

Closed
ghost opened this issue Mar 4, 2018 · 14 comments
Closed

"Client does not support authentication protocol requested by server" #744

ghost opened this issue Mar 4, 2018 · 14 comments

Comments

@ghost
Copy link

ghost commented Mar 4, 2018

Error: Client does not support authentication protocol requested by server; consider upgrading MariaDB client

This is a fresh install of MariaDB with an imported SQL dump and I ran the query SET PASSWORD FOR 'root'@'localhost' = PASSWORD('password').

@sidorares
Copy link
Owner

can't reproduce, I'm using maridb server from docker:

  1. start using docker run -p 3306:3306 --net=host -e MYSQL_RANDOM_ROOT_PASSWORD=1 -it mariadb
  2. run script twice first time using random password from log and doing SET PASSWORD FOR 'root'@'%' = PASSWORD('password'). query and second time using password password - both times succeed

@Alexander--
Copy link

@BamItsPixel you are most likely suffering from bugged socket auth (node-mysql bug #1507)

Try adding this to your code (where config is your configuration, passed to createConnection):

  config.authSwitchHandler = (unused, cb) => {
      // workaround for node mysql bug #1507
      if (pluginName === 'auth_socket') {
        cb(null, Buffer.alloc(0));
      } else {
        cb(new Error("Unsupported auth plugin"));
      }
    };

@sidorares
Copy link
Owner

thanks @Alexander-- for hint

Yes, as suggested by mysqljs/mysql#1507 (comment) the error might be visible when CLIENT_PLUGIN_AUTH capability flag is not set and we only set it when there is authSwitchHandler in config parameters

@dschnare
Copy link

This occurs for me when using the latest mysql docker image, MySQL version 8.x.

This is kind of a deal breaker right? I mean you can't connect to the latest MySQL server. Shouldn't this issue get the highest priortiy?

See: mysqljs/mysql#2002

@sidorares
Copy link
Owner

yes, it's high priority @dschnare and I already have almost ready for PR code to fix this. In the meantime solutions like mysqljs/mysql#1962 (comment) should work

@dschnare
Copy link

I appreciate your work on this @sidorares (and others). Sorry for coming across as an ass.

@sidorares
Copy link
Owner

no problems @dschnare , happy to have you review pr so you familiar with code involved ( if you want )

@ruiquelhas
Copy link
Contributor

@sidorares I promised myself I was going to submit a PR to fix the MySQL 8.0 issues similar to mysqljs/mysql#1962, but still haven't found time to do it. Since you are already working on it, feel free to let me know if you need any help or additional review.

@sidorares
Copy link
Owner

Thanks @ruiquelhas , I definitely want you to have a look at PR when it's ready ( and thanks for your work on mysqljs/mysql, my code is very much based on your ). Hope it'll be much smaller, I'm trying to make it use generic auth plugin system in the client ( so that all auth types are plugins, just some of them are pre-included - api similar to #560 (comment) )

@udaykiranreddydesam
Copy link

just update your mysql-connector-java to latest all works fine

@jlubeck
Copy link

jlubeck commented Nov 26, 2018

Any news here? Thanks!

@iedmrc
Copy link

iedmrc commented Nov 26, 2018

This is most common problem with Node.js mysql modules. I tried other mysql modules but unlucky attempts..

@ghost
Copy link
Author

ghost commented Nov 26, 2018

The solution given on here (code snippet above) worked for me. Try it out!

@ghost ghost closed this as completed Nov 26, 2018
@iedmrc
Copy link

iedmrc commented Nov 26, 2018

Hi,
I use a node.js framework and it's just support mysql and mysql2 npm modules. I cannot and shouldn't modify source code of framework but mysql2 module can be fixed internally by maintainers.
And also this is just a workaround. No one should be needed to implement this workaround. Mysql 8 auth methods should be supported natively.
Thanks!

This issue was closed.
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

7 participants