Wednesday, December 4, 2019

MySQL SQLSTATE[HY000] [1524] Plugin is not loaded

Hello,
Sometimes when working with PDOConnections to Mysql this errors is thrown,

..... In PDOConnection.php line XXXX:
  SQLSTATE[HY000] [1524] Plugin '*9CBB2AF8EB953A91706ADC84736447DE04E311E9' is not loaded
Note that, connection to database through command line or phpmyadmin web interface is possible and don"t raise exceptions

This error is probably due to password ecnryption method in Mysql
Follow these few steps
Connect to mysql using root:

>mysql -u root -p
-----Provide your password-----
>use mysql;
>update user set authentication_string=PASSWORD("USER_PASSWORD") where User='YOUR_USER';
>update user set plugin="mysql_native_password" where User='YOUR_USER';  # THIS LINE
>flush privileges;
>quit;