GreptimeTeam / greptimedb

An open-source, cloud-native, unified time series database for metrics, logs and events with SQL/PromQL supported. Available on GreptimeCloud.
https://greptime.com/
Apache License 2.0
4.23k stars 303 forks source link

Use Mysql client connect failed: 'mysql_native_password' cannot be loaded #4512

Open leaf-potato opened 1 month ago

leaf-potato commented 1 month ago

What type of bug is this?

Unexpected error

What subsystems are affected?

Distributed Cluster

Minimal reproduce step

  1. use gtctl create a cluster.
    gtctl playground
  2. use mysql client connect to greptimedb.
    mysql -h 127.0.0.1 -P 4002

What did you expect to see?

Use Mysql client connect to greptimedb successfully.

What did you see instead?

image

What operating system did you use?

Max OS Ventura 13.4 ARM

What version of GreptimeDB did you use?

0.9.0

Relevant log output and stack trace

ERROR 2059 (HY000): Authentication plugin 'mysql_native_password' cannot be loaded:  
dlopen(/opt/homebrew/Cellar/mysql/9.0.1/lib/plugin/mysql_native_password.so, 0x0002): tried:    
'/opt/homebrew/Cellar/mysql/9.0.1/lib/plugin/mysql_native_password.so' (no such file),  
'/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/Cellar/mysql/9.0.1/lib/plugin/mysql_native_password.so' (no  
such file), '/opt/homebrew/Cellar/mysql/9.0.1/lib/plugin/mysql_native_password.so' (no such file)
leaf-potato commented 1 month ago

Maybe mysql_native_password is no longer supported in mysql9.0?

evenyag commented 1 month ago

Related to https://github.com/datafuselabs/opensrv/issues/64

sunng87 commented 1 month ago

Checked some internals of mysql authentication process, this has to be purely implemented from our side.

  1. change default authentication plugin to caching_sha2_password
  2. implement password authentication in our auth module.
leaf-potato commented 1 month ago

Checked some internals of mysql authentication process, this has to be purely implemented from our side.

  1. change default authentication plugin to caching_sha2_password
  2. implement password authentication in our auth module.

Maybe I can give it a try, but I need some time to read the code.