Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

optimize: fix mysql connecting Exception (apache#662) #663

Closed
wants to merge 1 commit into from
Closed

optimize: fix mysql connecting Exception (apache#662) #663

wants to merge 1 commit into from

Conversation

Hinsteny
Copy link

Ⅰ. Describe what this PR did

add mysql connect param of '&allowPublicKeyRetrieval=true'

Ⅱ. Does this pull request fix one issue?

fixes #662

Ⅲ. Why don't you add test cases (unit test/integration test)?

integration test

Ⅳ. Describe how to verify it

exec at-sample by kind

Ⅴ. Special notes for reviews

No

Copy link
Contributor

@funky-eyes funky-eyes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this change may not be universally compatible with all versions of MySQL. This configuration should be adjusted based on individual user needs and is unrelated to sample data.

@Hinsteny
Copy link
Author

I believe this change may not be universally compatible with all versions of MySQL. This configuration should be adjusted based on individual user needs and is unrelated to sample data.

I think this config property is suitable for versions greater than 5.1.31.
ref: https://dev.mysql.com/doc/connector-j/en/connector-j-reference-configuration-properties.html

@@ -18,7 +18,7 @@ spring:
name: AccountApplication
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://${mysql.address:127.0.0.1}:${mysql.port:3306}/seata?serverTimezone=Asia/Shanghai&useSSL=false&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useOldAliasMetadataBehavior=true
url: jdbc:mysql://${mysql.address:127.0.0.1}:${mysql.port:3306}/seata?serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&useSSL=false&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useOldAliasMetadataBehavior=true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This combination doesn't seem to make sense; allowPublicKeyRetrieval and useSSL are generally enabled simultaneously. Q: I would like to know whether the password authentication related configuration is enabled in your database, and what the connection string of the final database (IP information can be removed) is like?

@Hinsteny Hinsteny closed this by deleting the head repository May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Connecting Mysql Server occurred an SQLNonTransientConnectionException when testing the case under at-sample
3 participants