Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to edit docker mysql image and increase connection limit

I am new docker concepts. I have mysql image which is already build. I want to increase mysql connection limit to 10000 within configuration file. I researching a lot about this, but I didn't found any clue on this. How can I get mysql configuration file and change settings?

like image 757
Sanjay Avatar asked Oct 20 '25 03:10

Sanjay


1 Answers

you can run the container like this:

docker run -d -e "MYSQL_ROOT_PASSWORD=test" mysql --max_connections=10000

or make your own Dockerfile:

FROM mysql
CMD [ "--max_connections=10000" ]

then build it:

docker build -t my_mysql .

and run it:

docker run -d -e "MYSQL_ROOT_PASSWORD=test" my_mysql
like image 110
LinPy Avatar answered Oct 21 '25 16:10

LinPy



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!