I create the mysql container in docker with url:
jdbc:mysql://172.17.0.2:3306/'databaseName'
172.17.0.2 is the IP address of the docker container. I create the user with:
CREATE USER 'saman'@'%' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON *.* TO 'saman'@'%' WITH GRANT OPTION;
when i want to connect from intllje Ide i connect successfully, but when i want to connect from my java application i got the exception :
Caused by: com.mysql.cj.core.exceptions.WrongArgumentException: Unable
to load authentication plugin 'caching_sha2_password'
also i changed the default authentication password from caching_sha2_password to mysql_native_password in mysql users. for more information when i use telnet command:
telnet 172.17.0.2 3306
return: caching_sha2_passwordConnection closed by foreign host.