Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Go connection Azure Mysql error Error 9002 how to solve

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

This article introduces the relevant knowledge of "how to solve Go connection Azure Mysql error Error 9002". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

About Go connection Azure Mysql error Error 9002: SSL connection is required. Please specify SSL options and retry.

Go = 1.12

Orm github.com/go-xorm/xorm

Driver github.com/go-sql-driver/mysql

Solution:

Mysql connection address configuration parameter tls

Tls parameter description

Type: bool / stringValid Values: true, false, skip-verify, preferred, Default: false

Tls=true enables TLS / SSL encrypted connection to the server. Use skip-verify if you want to use a self-signed or invalid certificate (server side) or use preferred to use TLS only when advertised by the server. This is similar to skip-verify, but additionally allows a fallback to a connection which is not encrypted. Neither skip-verify nor preferred add any reliable security. You can use a custom TLS config after registering it with mysql.RegisterTLSConfig.

Configure URL

Xorm.NewEngine ("mysql", "username:password@tcp (host:port) / dbname?tls=skip-verify&charset=utf8"); "Go connection Azure Mysql error Error 9002 how to solve" is introduced here, thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report