<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Hello,</p>
<p>I'm having trouble connecting QGIS 3.16 to a MySQL Server v
5.7.32 (iirc). The PC runs Linux Mint 20.2, based on Ubuntu 20.04.
The MySQL client library available in this system is
"libmysqlclient21", which is based on MySQL 8. This version of
MySQL changed the default authentication from
"mysql_native_password" to "caching_sha2_password". That means
that if you dont tell a MySQL8 client to use the older
authentication mechanism it will use the new one by default, which
won't work for a MySQL 5.7 server.<br>
</p>
<p> The error message I'm getting is:</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;">'Extended
error information:</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;">MySQL
connect failed for:
dbserver,host=10.10.4.4,port=3306,user=qgisuser,password=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Error: Access denied for user 'qgisuser'@'10.0.0.3' (using
password: NO)'</p>
<p>I have seen this error before using Python scripts which used old
libraries that did not allowed to set the auht mechanism to
"mysql_native_password" or did not read /etc/mysql/mysql.cnf for:</p>
<p>[client]<br>
default-auth=mysql_native_password</p>
<p>How can I tell QGIS to use "mysql_native_password" as the
authentication mechanism?</p>
<p>Thank you.</p>
<p><br>
</p>
<p><br>
</p>
<p><br>
</p>
</body>
</html>