pgloader icon indicating copy to clipboard operation
pgloader copied to clipboard

QMYND:MYSQL-UNSUPPORTED-AUTHENTICATION attempting to load data from mysql 8.0.4-rc.

Open nlevitt opened this issue 6 years ago • 56 comments

QMYND:MYSQL-UNSUPPORTED-AUTHENTICATION attempting to load data from mysql 8.0.4-rc.

I found that mysql's default_authentication_plugin changed in this version: https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_default_authentication_plugin That looked promising, but I got the same error after setting it to the old default value.

  • [ ] pgloader --version

    pgloader version "3.4.01f877bad7"
    compiled with SBCL 1.3.1.debian
    
  • [ ] did you test a fresh compile from the source tree?

yes

  • [ ] did you search for other similar issues?

yes

  • [ ] how can I reproduce the bug?

To install this version of mysql on ubuntu:

curl -sLSvO https://dev.mysql.com/get/mysql-apt-config_0.8.9-1_all.deb
sudo dpkg -i /tmp/mysql-apt-config_0.8.9-1_all.deb # choose 8.0
sudo apt-get update
sudo apt-get install mysql-server
$ lsb_release -d
Description:    Ubuntu 16.04.4 LTS
$ mysql --version
mysql  Ver 8.0.4-rc for Linux on x86_64 (MySQL Community Server (GPL))

Then run

sudo MYSQL_PWD=***** -u archiveit ./build/bin/pgloader --verbose mysql://archiveit@wbgrp-svc413/archiveit3 postgresql:///archiveit3
  • [ ] pgloader output you obtain
2018-04-17T23:56:47.055000Z NOTICE Starting pgloader, log system is ready.
2018-04-17T23:56:47.146000Z LOG Migrating from #<MYSQL-CONNECTION mysql://archiveit@wbgrp-svc413:3306/archiveit3 {10097067C3}>
2018-04-17T23:56:47.154000Z LOG Migrating into #<PGSQL-CONNECTION pgsql://archiveit@UNIX:5432/archiveit3 {1009941FF3}>
KABOOM! 
FATAL error: Failed to connect to mysql at "wbgrp-svc413" (port 3306) as user "archiveit": Condition QMYND:MYSQL-UNSUPPORTED-AUTHENTICATION was signalled.
An unhandled error condition has been signalled:
   Failed to connect to mysql at "wbgrp-svc413" (port 3306) as user "archiveit": Condition QMYND:MYSQL-UNSUPPORTED-AUTHENTICATION was signalled.




What I am doing here?

Failed to connect to mysql at "wbgrp-svc413" (port 3306) as user "archiveit": Condition QMYND:MYSQL-UNSUPPORTED-AUTHENTICATION was signalled.

  • [ ] data that is being loaded, if relevant

  • [ ] How the data is different from what you expected, if relevant

nlevitt avatar Apr 18 '18 00:04 nlevitt

Given https://github.com/qitab/qmynd/blob/master/src/mysql-protocol/authentication.lisp ; can you try the mysql_native_password on the server side? I guess we should now add the new default too, if that's possible. Do you want to look into doing that?

dimitri avatar Apr 20 '18 14:04 dimitri

What's the status on this?

I'm trying to migrate a mysql database to psql and getting this error

Deph0 avatar Jun 15 '18 08:06 Deph0

See https://github.com/qitab/qmynd/blob/master/src/mysql-protocol/authentication.lisp#L125 for the code handling the MySQL password challenge. The current status is that mysql_native_password authentication plugin is supported just fine, but caching_sha2_password is not there yet.

Also, a quick reading through https://dev.mysql.com/doc/refman/8.0/en/caching-sha2-pluggable-authentication.html shows that to enable that default authentication scheme we also need to implement the --get-server-public-key somehow.

How easy/complex is it to just setup mysql_native_password on the server for pgloader use?

dimitri avatar Jun 15 '18 15:06 dimitri

From what I've attempted, it was with no success to with pgloader- I may also be miss-informed but this is what I think is what you have to do (however, again- with little difference): ALTER USER 'youruser'@'localhost' IDENTIFIED WITH mysql_native_password BY 'yourpassword';

Deph0 avatar Jun 15 '18 22:06 Deph0

Using MySQL 8.0.11. Created a new user with mysql_native_password and empty password; also one with a password. Both connection attempts failed with QMYND:MYSQL-UNSUPPORTED-AUTHENTICATION.

19h avatar Jul 21 '18 20:07 19h

Dealing with this similar issue as well. Having a user identified by mysql_native_password doesn't work as well.

mysql --version
mysql  Ver 8.0.11 for osx10.13 on x86_64 (Homebrew)
KABOOM!
FATAL error: Failed to connect to mysql at "localhost" (port 3306) as user "ncalabroso": Condition QMYND:MYSQL-UNSUPPORTED-AUTHENTICATION was signalled.
An unhandled error condition has been signalled:
   Failed to connect to mysql at "localhost" (port 3306) as user "ncalabroso": Condition QMYND:MYSQL-UNSUPPORTED-AUTHENTICATION was signalled.




What I am doing here?

Failed to connect to mysql at "localhost" (port 3306) as user "ncalabroso": Condition QMYND:MYSQL-UNSUPPORTED-AUTHENTICATION was signalled.

nmcalabroso avatar Jul 24 '18 00:07 nmcalabroso

Can anyone describe the conditions in which pgloader works at all? Is there some magic combination of MySQL version, MySQL authentication method, OpenSSL version, and/or PostgreSQL version that works? I have had no success with any of the combinations I have tried so far. I always get either a The alien function "CRYPTO_num_locks" is undefined. or Condition QMYND:MYSQL-UNSUPPORTED-AUTHENTICATION was signalled. error.

Update: I got everything to work with MySQL (Amazon RDS) and PostgreSQL (localhost)

BrandonZacharie avatar Aug 04 '18 08:08 BrandonZacharie

When using debian, the SSL problems should be fixed in 3.5.2 packaging. Otherwise I'm not sure how to help you, SSL make things more complex than they seem. Then for MySQL, it's simple, the new default authentication scheme isn't yet supported in pgloader / qmynd, and I am currently lacking time to work on that. Contributions welcome!

dimitri avatar Aug 06 '18 13:08 dimitri

Same problem, mysql 8.0.12, turned mysql_native_password on, pgloader v3.5.2. Ubuntu 18.04 if it matters

ghost avatar Aug 15 '18 15:08 ghost

Same problem with mysql 8.0.15. It only worked after switching to mysql 5.7

jsangilve avatar Feb 25 '19 15:02 jsangilve

Any updates on this? I'm having the same issue.

rolurq avatar May 09 '19 13:05 rolurq

I have the same problem with mysql 8.0.16 installed in MacOs :-( (Mysql community server -gpl)

caiocutrim avatar May 13 '19 14:05 caiocutrim

Same problem here. Any workarounds?

anagram3k avatar Jun 11 '19 20:06 anagram3k

I had to go back to MySql 5.6. 5.7 and 8 did not work.

zoechi avatar Jun 12 '19 15:06 zoechi

@zoechi are you sure about 5.7? because I did the same and I got back to MySql 5.7 and it worked

rolurq avatar Jun 12 '19 16:06 rolurq

In order to avoid the QMYND:MYSQL-UNSUPPORTED-AUTHENTICATION error you have to switch your mysqld to use mysql_native_password by default.

Edit your my.cnf and in [mysqld] section add:

default-authentication-plugin=mysql_native_password

Then you need to update your user's password to mysql_native_password type like this:

ALTER USER 'youruser'@'localhost' IDENTIFIED WITH mysql_native_password BY 'yourpassword';

Voila.

Edit: I just want to make sure everyone understands, this means you are downgrading your authentication scheme, which is always a bad idea. This is a work-around, definitely not meant to be a permanent modification. But it gets the job done for a one-time migration. If you need to use pgloader periodically consider working on this issue or sponsoring it 🙂

lukaskuzmiak avatar Jun 15 '19 01:06 lukaskuzmiak

is it possible to change only the user, not whole server?

paveldvorak5 avatar Jul 20 '19 21:07 paveldvorak5

I can confirm that @lukaskuzmiak's answer does work with MySQL 8.0.17. It's a pain but it gets the job done. Thanks!

helsont avatar Sep 19 '19 09:09 helsont

Any status on this one? I'm using a digital ocean cluster for both and I'm trying to migrate from a MySql one to a postgres one, and can't change any mysql config, and also all the users authe method is native

denischiciudean avatar Oct 16 '19 18:10 denischiciudean

The lukaskuzmiak's workaround works for me too (mysql 8.0.18 on centos 7 - pgloader 3.6.1). Thanks to him !

fredow68 avatar Dec 17 '19 17:12 fredow68

Any progress on supporting MySQL 8.0's default authentication?? changing my.cnf file on the server is basically not an option.....

eugeneYWang avatar Apr 09 '20 00:04 eugeneYWang

As @paveldvorak5 stated, is it possible to make user level setting to work around this issue?

PS: tried ALTER USER command in MySQL 8, but then noticed that most users created before MySQL 8 already belong to mysql_native_password...., this means MySQL 8 is ignoring user-level setting. Otherwise, my user-level setting originally is already mysql_native_password..

This is the query I used to check:

select user,plugin,host from mysql.user where plugin = 'mysql_native_password';

However...still how that there is a workaround not changing my.cnf on the mysql server ....

eugeneYWang avatar Apr 09 '20 01:04 eugeneYWang

Yeah I still did not have time to work on the new default authentication scheme for MySQL 8.0.1 and later. If someone would like to help, that might be the most needed contribution to pgloader at the moment. Reminder: you can contribute your own time and skills or your company's money. I will then redirect the money to a Common Lisp hacker with free time in their hands, and yeah I have a list of people ready to do just that.

dimitri avatar Apr 11 '20 16:04 dimitri

Any luck with a fix? I'm on MySQL Azure PaaS v8, altered the user but like others said, it makes not difference. Changing my.cnf is not possible.

manoa2617 avatar Sep 18 '20 03:09 manoa2617

@dimitri , can you give us a very brief rundown on where to change the code? I am familar with crypto/sec, but not pgloader or how it's organized. I'd be happy to help get the ball rolling tho

blazespinnaker avatar Sep 25 '20 21:09 blazespinnaker

@blazespinnaker I think he has already mentioned that earlier in this thread, it is something that needs to appear in QMyND itself (IMHO), that is where the QMYND:MYSQL-UNSUPPORTED-AUTHENTICATION is coming from.

lukaskuzmiak avatar Sep 25 '20 21:09 lukaskuzmiak

Yes, perhaps not quite that brief. Anyways, no sweat. I am able to get this to work by change mysql.cnf

blazespinnaker avatar Sep 25 '20 21:09 blazespinnaker

is there anyway to avoid the QMYND:MYSQL-UNSUPPORTED-AUTHENTICATION error without modifying the my.cnf file ? because default-authentication-plugin would be considered a vulnerability issue

aym0406 avatar Oct 08 '20 21:10 aym0406

Any progress on supporting MySQL 8.0's default authentication?? changing my.cnf file on the server is basically not an option.....

@dimitri

aym0406 avatar Oct 08 '20 23:10 aym0406

@aym0406 I gave up pgloader. Currently it is not an option for cases like yours and mine.

eugeneYWang avatar Oct 09 '20 01:10 eugeneYWang