泡面师

  • 首页
  • 记录
golang
golang

golang使用mysql连接池

安装 go get github.com/go-sql-driver/mysql 初始化 import ( "database/sql" _ "github.com/go-sql-driver/mysql" ) var db, _ = sql.Open("mysql", "root:root@tcp(127.0.0.1:3306)/testmysql") func init(){ db.SetMaxOpenConns(threadNum) db.SetMaxIdleConns(threadNum / 2) } 查询…

2021-05-25 0条评论 2978点热度 0人点赞 泡面师 阅读全文
golang

golang使用redis连接池

安装 go get github.com/gomodule/redigo/redis 初始化 import ( "github.com/gomodule/redigo/redis" ) var pool *redis.Pool func init() { pool = &redis.Pool{ //实例化一个连接池 MaxIdle: 16, //初始连接数 MaxActive: 0, //池的最大连接数,0为自动 IdleTimeout: 300, //连接超时关闭时间 Dial: func() (redi…

2021-05-25 0条评论 2871点热度 0人点赞 泡面师 阅读全文
分类
  • centos (13)
  • golang (2)
  • PHP (4)
  • python (10)
  • 记录 (5)
最新 热点 随机
最新 热点 随机
golang使用mysql连接池 golang使用redis连接池 laravel7的日期格式问题 pyinstaller打包pyqt5后的程序报错Failed to execute script mac使用iterm2进行rzsz 网站设置301重定向
golang使用redis连接池 centos限制目录大小 Flask requests用session模拟登录 centos 7 修改ssh、ftp端口 linux 定时释放缓存 centos安装virtualenv和Flask
标签聚合
golang mysql go-redis redigo iterm2 scrapy redis git Flask centos

COPYRIGHT © 2024 泡面师. ALL RIGHTS RESERVED.

THEME KRATOS MADE BY VTROIS