dongzhenju3015 2019-02-21 19:24
浏览 70

是否可以在Go中设置SQL连接字符串?

I'm working on a Go project that interacts with a mysql database in several functions and go routines. I'm having a problem tracking down database connections being left open though.

Is it possible to set a connection string in Golang when working with mysql so that the connections can be identified in mysql when viewing the processlist?

I've reviewed the GO docs around the SQL package and cant find a function to do this. AN alternative is to set the connection lifetime, but for cleanliness I'd like to be able to identify the connections.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 如何在3D高斯飞溅的渲染的场景中获得一个可控的旋转物体
    • ¥88 实在没有想法,需要个思路
    • ¥15 MATLAB报错输入参数太多
    • ¥15 python中合并修改日期相同的CSV文件并按照修改日期的名字命名文件
    • ¥15 有赏,i卡绘世画不出
    • ¥15 如何用stata画出文献中常见的安慰剂检验图
    • ¥15 c语言链表结构体数据插入
    • ¥40 使用MATLAB解答线性代数问题
    • ¥15 COCOS的问题COCOS的问题
    • ¥15 FPGA-SRIO初始化失败