It seems to me that you are developing a PHP application, not a Java one, thus you're not using Connector/J, so this question should posted in the PHP forum.
It also seems that you are not using one of the latest server versions.
Trying to help you, though:
1. I would recommend upgrading your MySQL server if possible.
2. You should look for the server documentation on setting it's default character set and collation (https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_character_set_server)
3. And also check how to configure the character set in your PHP application. Maybe start here:
http://php.net/manual/en/mysqli.set-charset.php.
Can't help you much more. Please check in the PHP forum if someone else can help you.