mysql icon indicating copy to clipboard operation
mysql copied to clipboard

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

Open ameijboom opened this issue 6 years ago • 9 comments

I'm trying to connect my Discord bot to my server's MySQL database, but everytime I try to run the bot I get the following error:

let conn = mysql.createConnection({ insecureAuth : true, host : config.mysql.host, user : config.mysql.user, password : config.mysql.password, database : config.mysql.database });

config.json: { "token":"bottoken", "prefix":"m!", "mysql": { "host":"localhost", "user":"root", "password":"apassword!", "database":"aphi" } }

ameijboom avatar Apr 19 '18 12:04 ameijboom

We could add more auth methods, of course. What auth method is your server using?

dougwilson avatar Apr 19 '18 12:04 dougwilson

Where can I see which auth method my server uses ? (Sorry, I'm not that smart when it comes to MySQL & servers)

ameijboom avatar Apr 19 '18 15:04 ameijboom

No problem. I'm not at a computer right now, but I think it is one of the columns in the mysql.user system table row for the user you are trying to authenticate as.

dougwilson avatar Apr 19 '18 15:04 dougwilson

It says my auth method is unix_socket image

ameijboom avatar Apr 20 '18 07:04 ameijboom

duplicate of #1507

sidorares avatar Apr 20 '18 10:04 sidorares

well, kind of, need to confirm if auth_socket in mysql is same as unix_socket in mariadb. I think both rely on SO_PEERCRED

sidorares avatar Apr 20 '18 10:04 sidorares

just run that mySQL query command in workbench or other mySQL client : 'root' should be your 'username' or 'root' and where 'password' your 'password'

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password'

Eug13 avatar Dec 04 '18 08:12 Eug13

is there a solution for this ? other than ALTERing USER ?

karocksjoelee avatar Jan 10 '19 04:01 karocksjoelee

This issue is specific to the original report issue, which is to support the unit_socket auth plugin (https://github.com/mysqljs/mysql/issues/2001#issuecomment-383004539). Please create a new issue if your issue is not related to the unix_socket plugin.

dougwilson avatar May 30 '19 02:05 dougwilson