How to find out the mysql service on linux server.
I have tried it .
[root@anjum/]# service mysqld status
mysqld: unrecognized service
[root@anjum/]# service mysql status
mysql: unrecognized service
service mysql status
mysql: unrecognized service
Just remember if you are using MySQL via a docker container (say maybe MySQL:8.0) then in many of the images you will not have the service management utilities to do this.
service mysqld status
orservice mysql status
will give youunrecognized service
even though the service is running fine and you can log into the MySQL prompt usingmysql -uroot -p
and start executing queries without any problems.
This has to do with the way that the docker container was set up, to keep the container as small as possible. If for some reason you want to restart mysql, then the standard way would be to restart the container.
First make sure that mysql is installed on your server by below steps-
Step1:
cat /etc/my.cnf
get data directory from here suppose it is /var/lib/mysql
Step2: check if all related mysql files are there-
ls -lh /var/lib/mysql
You can also check by below command:
ls /etc/init.d | grep mysql
If everything is ok and still showing unrecognized. Then you have to check if same ip alloted to some other server.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With