-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
mysql 8 new authentication method caching_sha2_password #454
Comments
I don't believe this is a viable solution -- to maintain a non-default feature that is rather simple to work around if need be: connecting with This is upstream's explanation as for why it's the preferred authentication plugin https://dev.mysql.com/doc/refman/8.0/en/upgrading-from-previous-series.html#upgrade-caching-sha2-password |
@wglambert hmmm yes and no. |
In this case, changing the default authentication method was an intentional choice by upstream, which is their prerogative. In this case, they even decided to only do so when changing from MySQL 5 to MySQL 8, which is a major version bump (and I'd be very surprised if this is the only breakage introduced in the change), and that was very kind of them. As packagers of their solution, I do not believe it is appropriate for us to change this new default simply for the sake of compatibility with the older version, especially given that folks can still continue to use Any folks using |
In this case could you please suggest simplest set of commands I should issue on clean running mysql 8 container to be able to use |
@chilio simply add |
@tianon thank you, just a 5 mins ago figured that out. |
It not working. |
You didn't give a password version: '3'
services:
author_db:
image: mysql:8.0.12
command: --default-authentication-plugin=mysql_native_password
environment:
MYSQL_ROOT_PASSWORD: pass
restart: always
ports:
- "3306:3306" $ docker-compose up -d
Creating network "mysql-454_default" with the default driver
Pulling author_db (mysql:8.0.12)...
8.0.12: Pulling from library/mysql
Digest: sha256:038f5f6ea8c8f63cfce1bce9c057ab3691cad867e18da8ad4ba6c90874d0537a
Status: Downloaded newer image for mysql:8.0.12
Creating mysql-454_author_db_1 ... done
$ docker-compose logs --tail 3
Attaching to mysql-454_author_db_1
author_db_1 | 2018-09-28T17:27:18.867303Z 0 [Warning] [MY-010330] [Server] 'tables_priv' entry 'user mysql.session@localhost' ignored in --skip-name-resolve mode.
author_db_1 | 2018-09-28T17:27:18.867325Z 0 [Warning] [MY-010330] [Server] 'tables_priv' entry 'sys_config mysql.sys@localhost' ignored in --skip-name-resolve mode.
author_db_1 | 2018-09-28T17:27:18.870988Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.12' socket: '/var/run/mysqld/mysqld.sock' port: 3306 MySQL Community Server - GPL.
$ docker exec -it mysql-454_author_db_1 mysql -uroot -ppass
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 10
Server version: 8.0.12 MySQL Community Server - GPL
Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> |
import mysql.connector def connect(): if name == 'main': Output : Connected to MySQL databaseFollow the Screenshot 👍 Stop database server in preferences. |
@wglambert I have tried the following docker-compose.yml file:
but I can't access to mysql using docker exec as you have explained and I face with the following error:
For more detail please check (this link)[https://stackoverflow.com/questions/57347415/cant-monitor-mysql-using-prometheus-docker-and-prom-mysqld-exporter-image] |
@NicolasFCO Hi Nicolas, it still doesn't work! what should I do? I have also done the last method you said in the link you've sent. |
@mostafaghadimi try to remove your images by using: |
@NicolasFCO I've also done that, but I faced with the following error:
More Detail: I use |
@mostafaghadimi, I think you might have an issue in your yaml. There are spaces in the env values for MySQL and I don't think it will handle those in the way you expect: environment:
- MYSQL_ROOT_PASSWORD= password
- MYSQL_DATABASE= db
- MYSQL_USER= mostafa
- MYSQL_PASSWORD= ghadimi
# should be:
environment:
- MYSQL_ROOT_PASSWORD=password
- MYSQL_DATABASE=db
- MYSQL_USER=mostafa
- MYSQL_PASSWORD=ghadimi
|
@mostafaghadimi Try deleting the mysql volume path on your system:
So delete the |
if you are facing "caching_sha2_password" error during connectivity of your mysql database using python , |
how to enable mysql_native_password when running in swarm mode using compose file |
@dheerajv4855 that plugin is removed in 8.4 |
|
yes this also works and it is simplest way |
They not only changed the variable name, but have officially deprecated the functionality with the intent to remove it completely in the future. Whatever you're using that needs this setting/functionality needs to be updated before that happens or you will be "stuck" using older MySQL versions (which will also eventually be unsupported/EOL). |
This new auth method brings breaking changes to a lot of frameworks/workflows.
I see a lot of emerging questions regarding this...
Maybe it would be good idea to have 8 version images with old auth method also, for backwards compatibility?
The text was updated successfully, but these errors were encountered: