Docker Community Forums

Share and learn in the Docker community.

Unable to start MySql in docker container


I am trying to install MySql8 community-server in my docker container instead of using the MySql docker hub. And my docker image is build with FROM amazoncorretto:11 as buildImage
I am going with the yum install route to install the MySql in docker but i am not able to start the MySql server at all.

yum localinstall -y mysql80-community-release-el7-1.noarch.rpm
yum install -y mysql-community-server

To start i used the below commands but nothing worked out for me.

1. service mysqld start : service command not found
2. /etc/init.d/mysql start : file or directory does not exist
3. /usr/sbin/mysql start : file or directory does not exist
4. systemctl start mysqld.service : Failed to get D-Bus connection: Operation not permitted

I wanted to install MySql using yum and start the server. Can someone help me finding out what am i doing wrong here ?

Thanks In Advance .