Skip to content
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

ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client #2013

Closed
OysteinAmundsen opened this issue May 12, 2018 · 1 comment

Comments

@OysteinAmundsen
Copy link

OysteinAmundsen commented May 12, 2018

Using:

  • docker hub mysql latest: v8.0.11
  • Latest Mysql client from npm: v2.15.0
  • Node 8.11.1
  • Connecting through TypeORM: v0.2.5

I'm getting this error, but I have done nothing to tweak the defaults anywhere.

Error:

Error during schema synchronization:
 { Error: ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client
     at Handshake.Sequence._packetToError (/usr/src/app/node_modules/mysql/lib/protocol/sequences/Sequence.js:52:14)
     at Handshake.ErrorPacket (/usr/src/app/node_modules/mysql/lib/protocol/sequences/Handshake.js:130:18)
     at Protocol._parsePacket (/usr/src/app/node_modules/mysql/lib/protocol/Protocol.js:279:23)
     at Parser.write (/usr/src/app/node_modules/mysql/lib/protocol/Parser.js:76:12)
     at Protocol.write (/usr/src/app/node_modules/mysql/lib/protocol/Protocol.js:39:16)
     at Socket.<anonymous> (/usr/src/app/node_modules/mysql/lib/Connection.js:103:28)
     at emitOne (events.js:116:13)
     at Socket.emit (events.js:211:7)
     at addChunk (_stream_readable.js:263:12)
     at readableAddChunk (_stream_readable.js:250:11)
     --------------------
     at Protocol._enqueue (/usr/src/app/node_modules/mysql/lib/protocol/Protocol.js:145:48)
     at Protocol.handshake (/usr/src/app/node_modules/mysql/lib/protocol/Protocol.js:52:23)
     at PoolConnection.connect (/usr/src/app/node_modules/mysql/lib/Connection.js:130:18)
     at Pool.getConnection (/usr/src/app/node_modules/mysql/lib/Pool.js:48:16)
     at /usr/src/app/node_modules/typeorm/driver/mysql/MysqlDriver.js:694:18
     at new Promise (<anonymous>)
     at MysqlDriver.createPool (/usr/src/app/node_modules/typeorm/driver/mysql/MysqlDriver.js:691:16)
     at MysqlDriver.<anonymous> (/usr/src/app/node_modules/typeorm/driver/mysql/MysqlDriver.js:250:51)
     at step (/usr/src/app/node_modules/typeorm/driver/mysql/MysqlDriver.js:32:23)
     at Object.next (/usr/src/app/node_modules/typeorm/driver/mysql/MysqlDriver.js:13:53)
   code: 'ER_NOT_SUPPORTED_AUTH_MODE',
   errno: 1251,
   sqlMessage: 'Client does not support authentication protocol requested by server; consider upgrading MySQL client',
   sqlState: '08004',
   fatal: true }
 npm ERR! code ELIFECYCLE
 npm ERR! errno 1
 npm ERR! gymsystems@1.1.0 db:sync: `typeorm schema:sync && yarn migrations:run`
 npm ERR! Exit status 1
 npm ERR! 
 npm ERR! Failed at the gymsystems@1.1.0 db:sync script.
 npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

docker-stack.yml

db:
  image: 'mysql:latest'
  restart: on-failure
  environment:
    - MYSQL_DATABASE=myDB
    - MYSQL_PASSWORD=password
    - MYSQL_ROOT_PASSWORD=password
    - MYSQL_USER=myuser
  volumes:
    - '/usr/src/app/data:/var/lib/mysql'
client:
  image: 'dockerhubuser/client:latest'
  autodestroy: on-success
  autoredeploy: true
  restart: on-failure
  environment:
    - DATABASE_HOST=db
    - NODE_ENV=production
  links:
    - db
  volumes:
    - '/usr/src/app/log:/usr/src/app/log'
    - '/usr/src/app/media:/usr/src/app/media'
nginx:
  image: 'dockerhubuser/nginx'
  autodestroy: on-success
  autoredeploy: true
  restart: on-failure
  environment:
    - TZ=UTC
  links:
    - client
  ports:
    - '80:80'
    - '443:443'
  volumes:
    - '/usr/src/app/cert/ssl:/etc/nginx/ssl'

I tried switching to insecureAuth : true as suggested by https://stackoverflow.com/questions/44946270/er-not-supported-auth-mode-mysql-server, but this gave me the same error.

I looked at #1574 , but the solution here returns:
ERROR 1396 (HY000): Operation ALTER USER failed for 'system'@'localhost' .

Not sure if #1507 applies here, as I do not think I'm using auth_socket.

Perhaps #2001 is related, but this does not provide any solutions.

I tried to downgrade Typeorm, as this error first surfaced after a typeorm upgrade, but nothing changed. Same error. My only suspect now, is the docker image for mysql perhaps changed at the same time, giving me an upgraded mysql version.

What can I do?

@dougwilson
Copy link
Member

You are using MySql 8 which the default auth is not yet supported. We're working to get it added currently. Duplicate of #2002

OysteinAmundsen added a commit to OysteinAmundsen/gymsystems that referenced this issue May 12, 2018
@mysqljs mysqljs deleted a comment from ttfreeman Jun 30, 2018
@mysqljs mysqljs deleted a comment from ttfreeman Jun 30, 2018
@mysqljs mysqljs locked and limited conversation to collaborators Jun 30, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

2 participants