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

x/website: Tutorial: Accessing a relational database mysql cfg example does not work #60319

Closed
vansharora03 opened this issue May 20, 2023 · 1 comment

Comments

@vansharora03
Copy link

What is the URL of the page with the issue?

https://go.dev/doc/tutorial/database-access

What is your user agent?

Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36

Screenshot

image

What did you do?

Follow the instructions on the database-access tutorial. The expected result is not achieved at "Get a database handle and connect" part 3.

What did you expect to see?

Successful Connected! message

What did you see instead?

Before I changed my password method to native (see https://stackoverflow.com/questions/50093144/mysql-8-0-client-does-not-support-authentication-protocol-requested-by-server): MySQL server does not support required protocol 41+

After I changed it: 2023/05/20 14:29:31 this user requires mysql native password authentication. exit status 1

I was able to fix this issue by setting AllowNativePasswords: true.
image

My theory is that since mysql.Config{} does not set default values, AllowNativePasswords does not get set to its intended default of true (perhaps using NewConfig is a better idea?). A possible change to the tutorial documentation may help newcomers who are attempting this tutorial. I believe a simple additional section to the tutorial for troubleshooting could be added, or perhaps a change to the example code itself? I would be open to implementing this change if possible. Any help is greatly appreciated! Thanks.

@gopherbot gopherbot added this to the Unreleased milestone May 20, 2023
@seankhliao
Copy link
Member

Duplicate of #49134

@seankhliao seankhliao marked this as a duplicate of #49134 May 20, 2023
@seankhliao seankhliao closed this as not planned Won't fix, can't repro, duplicate, stale May 20, 2023
@golang golang locked and limited conversation to collaborators May 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants