I'm using MySQL 5.7.24 and PHP 7.2.10. MySQL is configured with SSL. I have a user my_user with password abc123. I have tried configuring with both authentication plugins:
ALTER USER 'my_user'@'192.168.192.150' IDENTIFIED WITH sha256_password BY 'abc123';
ALTER USER 'my_user'@'192.168.192.150' IDENTIFIED WITH mysql_native_password BY 'abc123';
From my PHP server, I can successfully connect using the mysql command line client without specifying anything other than the host, user, and password. However, from PHP, I can connect only when using mysql_native_password. Not when using sha256_password.
The following PHP code works fine with mysql_native_password:
$mysqli = mysqli_init();
$mysqli->options(MYSQLI_OPT_CONNECT_TIMEOUT, 5);
$con = $mysqli->real_connect('192.168.19