Skip to content

Commit 2c09d50

Browse files
author
Gaetano Giunta
committed
fix auth problems with mysql 8.0
1 parent 73a134c commit 2c09d50

File tree

6 files changed

+16
-3
lines changed

6 files changed

+16
-3
lines changed

TODO.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
- fix auth problems with mysql 8.0
2-
31
- worker: improve sql execution cmd:
42
+ allow it to take sql snippet from file
53
+ allow it to pick a set of desired servers
64
+ at end show results + time & mem taken for each db
75

6+
- add travis testing
7+
88
- worker: improve profile of 'user' account (esp: add APP_ENV and APP_DEBUG env vars)
99

1010
- web: allow to insert sql snippet, pick the desired servers, run it and show results

WHATSNEW.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ Version 0.2 (unreleased)
33

44
- Fixed: sql commands executed against mariadb would be reported as failed
55

6+
- Fixed: auth problems with mysql 8.0
7+
68

79
Version 0.1
810
-----------

docker/config/mysql/8.0/small.cnf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
[mysqld]
12
# avoid connection errors "Authentication plugin 'caching_sha2_password' cannot be loaded"
23
default_authentication_plugin=mysql_native_password

docker/images/mysql/8.0/bootstrap.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,12 @@ trap clean_up TERM
4949

5050
/entrypoint.sh $@ &
5151

52+
# Fix the auth method for the 2 users which we create by default, to make it easier to connect for older clients
53+
# @todo is there a better method than sleeping for a while to find out when mysql is fully functional and listening on network?
54+
sleep 5
55+
mysql -h 127.0.0.1 -u root -p${MYSQL_ROOT_PASSWORD} -e "ALTER USER '${MYSQL_USER}'@'%' IDENTIFIED WITH mysql_native_password BY '${MYSQL_PASSWORD}';"
56+
mysql -h 127.0.0.1 -u root -p${MYSQL_ROOT_PASSWORD} -e "ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '${MYSQL_ROOT_PASSWORD}';"
57+
5258
echo "[`date`] Bootstrap finished" | tee /var/run/bootstrap_ok
5359

5460
tail -f /dev/null &

docker/images/mysql/8.0/initdb.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env bash
2+
3+
# Fix the auth method for the 2 users which we create by default, to make it easier to connect for older clients
4+
mysql -h 127.0.0.1 -u root -p${MYSQL_ROOT_PASSWORD} -e "ALTER USER '${MYSQL_USER}'@'%' IDENTIFIED WITH mysql_native_password BY '${MYSQL_PASSWORD}';"
5+
#mysql -h 127.0.0.1 -u root -p${MYSQL_ROOT_PASSWORD} -e "ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '${MYSQL_ROOT_PASSWORD}';"

docker/pippo

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)