MySQL plugin Standard is not loaded - mysql

I was trying to reinstall MySQL server 8.0 in order to use legacy authentication method, but got the following error in log when installer was attempting to start the server:
MySQL error 0: Authentication to host 'localhost' for user 'root'
using method 'mysql_native_password' failed with message: Plugin
'Standard' is not loaded
How can i fix it?

caching_sha2_password is the default authentication mechanism in 8.0. So use a client that support this. Or using the mysql-8.0 client, create a new user using CREATE USER:
CREATE USER 'vyacheslav'#'localhost'
IDENTIFIED WITH mysql_native_password BY 'password';

Related

Can the MySQL authentication plugin used by PrismaDB be changed?

I'm getting the following error using PrismaDB.
Error: Error in connector: Error querying the database: Error querying the database: Error querying the database: Unknown authentication plugin sha256_password'.`
I know that changing my MySQL user authentication plugin will work.
ALTER USER 'my_user'#'localhost' IDENTIFIED WITH sha256_password BY 'my_password';
But the problem is I need root access to do that, and I don't have it. Is there a way to change the authentication plugin used by PrismaDB? In my case, use "mysql_native_password" instead of "sha256_password".

ER_NOT_SUPPORTED_AUTH_MODE issue with Keira3

I'm having an issue connecting to the SQL database using the program Keira3 (version 3.0.2).
Error: Client does not support authentication protocol requested by
server; consider upgrading MySQL client
Code: ER_NOT_SUPPORTED_AUTH_MODE Errno: 1251 SQL State: 08004
Unfortunately the mysql library used by Keira3 does not support the new Mysql 8.0 authentication protocol, to change it you can run:
ALTER USER 'root'#'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
There is an open issue for this problem.

Authentication plugin 'caching_sha2_password' is not supported using Flask-Sqlalchemy and MySQL

I'm connecting to MySQL (8.0) database with Flask here's the error:
Authentication plugin 'caching_sha2_password' is not supported
I created the database 'user' by this sql command:
ALTER USER 'my_user'#'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
flush privileges;
quit;
I keep getting the same error though. How can I address this?
I suspect the legacy plugin can no longer be used as I tried to include it in my.cnf file and the MySQL server failed to start after relaunch.
Using this uri helped in my case:
'mysql+mysqlconnector://user:password#localhost/db?auth_plugin=mysql_native_password'

PDOException::("PDO::__construct(): Unexpected server respose while doing caching_sha2 auth: 109") with MySQL 8 / PHP 7.2 / Laravel

I just installed my dev environnement.
When I try to connect mysql db via SequelPro, I get:
Authentication plugin 'caching_sha2_password' cannot be loaded
As stated in: Authentication plugin 'caching_sha2_password' cannot be loaded, I ran:
ALTER USER 'root'#'localhost' IDENTIFIED WITH mysql_native_password BY '';
Then I could connect my DB via SequelPro
But when I execute Laravel Command:
php artisan migrate
I get:
PDOException::("PDO::__construct(): Unexpected server respose while doing caching_sha2 auth: 109")
What should I do now ?
PD: I use Laravel Valet on Mac, and Laravel 5.6.
You must alter use in your laravel app via shell with mysql command
ALTER USER 'user'#'localhost' IDENTIFIED WITH caching_sha2_password BY 'your password';
ALTER USER 'user'#'%' IDENTIFIED WITH caching_sha2_password BY 'your password';
the problem is good for safety, mybe.
but I use the command solve the problem:
ALTER USER root#localhost IDENTIFIED WITH caching_sha2_password BY 'password';
restart mysql
try now
Hope you will not see this error again.
After using $ mysql -uUser -pPa$$w0rd the MySQL connection could be opened with PHP using mysqli_real_connect() or PDO
Make sure that the User has caching sha2 password active, not a native password. (PHP 7.2.9-1, MySQL 8.0.12)
When changing to a native password PHP says
mysqli::real_connect(): Unexpected server respose while doing caching_sha2 auth: 109
With caching sha2 password active i always get:
mysqli::real_connect(): (HY000/1045): Access denied for user 'User'#'localhost' (using password: YES)
So tried to login from Shell using $ mysql, which succeeded, after this, i was able to connect with PHP. Seems like a Bug in the PHP mysqlnd.
Implementing a shell_exec('mysql -u'.$user.' -p"'.$password.'" -e quit > /dev/null 2>&1'); right before opening the MySQL connection, solves the issue, by now, for me.
Rebooting or restarting the MySQL Service, resets the cached password and the access denied message will pop again.
Hope this helps.
Greetings

"Authentication plugin 'caching_sha2_password'

I'm new to MySql environment and installed :
MySQL with the following commands:
sudo apt-get update
sudo apt-get install mysql-server
mysql_secure_installation
and also installed mysql workbench.
But when I'm trying to connect my localhost getting the follow error:
"Authentication plugin 'caching_sha2_password' cannot be loaded: /usr/lib/mysql/plugin/caching_sha2_password.so: cannot open shared object file: No such file or directory"
and even this is the first time I'm posting a question in stackoverflow, sorry for my presentation errors and syntax.
So I found the reason for that error message (at least for my case).
It's because MySQL as of version 8.04 and onwards uses caching_sha2_password as default authentication plugin where previously mysql_native_password has been used.
This obviously causes compatibility issues with older services that expect mysql_native_password authentication.
Solutions:
Check for an updated version of the client service you are
using (most recent workbench for instance).
Downgrade the MySQL Server to a version below that change.
Change the authentication plugin on a per user basis (I didn't find a global option, maybe there exists one though).
Now regarding option 3 this is as simple as altering the user:
ALTER USER user
IDENTIFIED WITH mysql_native_password
BY 'pw';
or when creating the user:
CREATE USER 'username'#'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
See MySQL Server Blog
See Oracle
Some more details coming here:
That caching_sha2_password plugin is the new default authentication plugin on MySQL 8 server. Only the libmysql library from that MySQL 8 distribution owns this plugin, and it is built statically into libmysql - the C-connector for various clients. That caching_sha2_password is not available separately for downloading.
This is the very first time that libmysql has an important plugin statically included. And this causes any other libmysql (including libmariadb and also older libmysql's) not to connect to MySQL 8 with a user which is defined to use that caching_sha2_password authentication.
I just hope that the guys from MariaDB are so nice to also include that caching_sha2_password in their libmariadb, to restore the drop-in-compatibility between MySQL and MariaDB.
From MySQL's server blog:
Support for caching_sha2_password was added in MySQL 8.0.3. Older
versions of libmysqlclient do not support this plugin. So, although
client tools that use libmysqlclient older than one available with
MySQL 8.0.3 can connect to MySQL 8.0.4 server using users that use
other authentication plugins such as mysql_native_password or
sha256_password, such client cannot connect to MySQL 8.0.4 server
using users which require caching_sha2_password support. For an
upgraded database, it means connecting using an existing user account
should not face any issues.
In the my.cnf file add the following line:
default-authentication-plugin=mysql_native_password
then restart the server.
The latest MYSQL versions have 'caching_sha2_password' as the default authentication type. Which does not allow remote connections to MYSQL and results in caching_sha2_password plugin error.
I have fixed it using
ALTER USER 'yourusername'#'localhost' IDENTIFIED WITH mysql_native_password BY 'yourpassword';
Now it allows your user to access MySQL from localhost.
If you want to access MySQL from multiple remote hosts then do the following,
**
ALTER USER 'yourusername'#'%' IDENTIFIED WITH mysql_native_password BY
'youpassword';
**
After every alter command in SQL run the following to take effect.
FLUSH PRIVILEGES;
OR restart MySQL server
Login to Mysql or your workbench, and run the following statement for any user who has this issue:
alter USER 'YOURUSERFORMYSQL'#'localhost' identified with mysql_native_password by 'YOURPASSWORD'
In case you did not create the user yet, you can activate this feature during the user creation.
create USER 'NEWUSER'#'localhost' identified with mysql_native_password by 'NEWPASSWORD'