I have tried pretty much everything on this page. Still same error. Interestingly enough I even used a none existing user in the connection string to see if it was even making that far and it is not. It still says returns “The server requested authentication method unknown to the client”
I did try messing with the port, etc. just to make sure it was not on my end and got the errors that I expected.
I can connect fine from Navicat and verified everything…
mysql> select user,plugin,host from mysql.user where user='test_user';
+-----------+-----------------------+------+
| user | plugin | host |
+-----------+-----------------------+------+
| test_user | mysql_native_password | % |
+-----------+-----------------------+------+
1 row in set (0.08 sec)
However when I try to connect with the following I still get the problem…
$vars['db_host'] = 'cyco-test-mysql-do-user-2169087-0.db.ondigitalocean.com:25060';
$vars['db_user'] = 'test_user';
$vars['db_pass'] = 'password';
$conn = new mysqli($vars['db_host'], $vars['db_user'], $vars['db_pass'] );
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
echo "Connected successfully";
I am actually a little surprised that DO decided to go with the “new” default from MySQL 8, that very little actually supports yet, versus the standard that most already use. At the very least they should have an option at the server level versus the user level. Tons of people having the problem, after searching. (not exclusive to DO)