并发事务中的golang mysql客户端连接错误

I am using the DB.Begin method. Everything is good in a single threaded environment. However, in a multithreaded environment (let's say 50 threads), some calls return either of the following errors:

dial tcp 127.0.0.1:33306: getsockopt: connection reset by peer

or

driver: bad connection

The max_connections global variable is set to 0 (which is infinite number of concurrent connections). Is there some other setting I am missing here to avoid these intermittent errors ?