By djekspek
I’m working with digitalocean for the first time and I try to connect my golang application (set-up as an app incl. builds from gitlab) to a mysql dbase (as dbase cluster). The golang build is ok, and I can connect to the mysql database using mysql workbench on my local pc.
However, the application itself cannot access the managed mysql database (i added it to trusted sources). When the application tries to connect, I get the following error:
[ERROR] Unable to open database [default addr for network ‘private-xxxxxxxxxx-mysql-do-user-xxxxxxxx-0.b.db.ondigitalocean.com:25060’ unknown]
I tried using the default environment variable DATABASE_URL, as well as manually setting the connectstring (with of course the correct details):
user:password@private-xxxxxxxx-mysql-do-user-xxxxxxx-0.b.db.ondigitalocean.com:25060/dbase?ssl-mode=REQUIRED
Could it be that i have to install something else, or maybe another mysql client or install a certificate? Btw i used the github.com/go-sql-driver/mysql package in golang.
Any help is appreciated!
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
oh i found the issue, it was the ssl-mode parameter that was not supported (used tls instead)
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.