Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OperationalError: (2059, "Authentication plugin 'caching_sha2_password' cannot be loaded: The specified module could not be found.\r\n") [duplicate]

Tags:

python

when running this code:

    import MySQLdb 
     db = MySQLdb.connect( host = '127.0.0.1', port=3307, user = 'root', 
     passwd = 'root', db = 'root') 
     cursor = db.cursor()
     db.close()

display:

OperationalError: (2059, "Authentication plugin 'caching_sha2_password' cannot be loaded: The specified module could not be found.\r\n")

like image 204
shimaa Avatar asked May 05 '18 10:05

shimaa


Video Answer


2 Answers

Go to MySQL Workbench -> Server-> Users and Privileges

  1. Click Add Account

  2. Under Login Tab provide new details and make sure to choose the Authentication Type as standard and choose respective administrative roles and Schema Privileges

enter image description here

enter image description here

like image 32
Deepak rayathurai Avatar answered Sep 16 '22 16:09

Deepak rayathurai


Running this dockerized, localhost likely is not your hostname. Try this instead:

ALTER USER 'user'@'%' IDENTIFIED WITH mysql_native_password BY 'password';

like image 65
tvgriek Avatar answered Sep 16 '22 16:09

tvgriek