1. 程式人生 > >C# 連線mysql,連線後顯示多個執行緒池

C# 連線mysql,連線後顯示多個執行緒池

資料庫連線字串

return string.Concat(new string[]
            {
                "Database='",
                this._DBName,
                "';Data Source='",
                this._ServerName,
                "';Persist Security Info=True;min pool size=20;max pool size=10240;Connection Timeout = 15;Pooling=true;User Id='",
                this._LoginUser,
                "';Password='",
                this._PassWord,
                "';charset='",
                this._Charset,
                "';AllowUserVariables=true;pooling=true"
            });

連線成功,連線池就會初始化並建立設定的最小連線數 (min pool size)

-- 顯示連線數-- 會顯示多個執行緒池
SHOW PROCESSLIST

參考:https://www.cnblogs.com/supersnowyao/p/8652722.html