Unable to start or stop Mysql – CentOS 7
Unable to start or stop Mysql – CentOS 7

Unable to start or stop Mysql – CentOS 7

Yesterday I decided to order a new vps server. After attempting to fully configure the server (CentOS 7 with CWP) with all the requirements (setting up a user account with hosting, email and shell access), I decided to re-install the OS and take CentOS 7 and webmin instead. The re-install was successful but now I needed to recover/change the root admin user of the database server because that information (password) is typically available when the installation is done manually/live and not during a re-image/re-install. Today, I started the password change steps but I soon realized I was not able to shut down (see screenshot below) the mysql database server.

mysql-not-running
mysql not running

I checked the webmin panel (screenshot below) and saw the mysql path and owner being active so I was really puzzled as to why I was not able to stop the myql server. It turns out that CentOS started shipping MariaDB server instead of Mysql database server.

processes-in-webmin
processes in webmin

Looking at the installation (see screenshot below maria-0_m) there was only one component of mysql installed but it was not active and there are three components of MariaDB installed.

mariaDB-is-installed
mariaDB is installed

To reset the password, the database server needs to be stopped and then safe mode is engaged where the user will then be allowed to log in without a password. During that login, the password is reset. The following screenshots highlight these steps. Also, the port (3306) MariaDB server runs on is the same as Mysql and the interaction is also similar – typing ‘mysql’ at the prompt to engage the database server on the command line.

Honestly at first I thought this issue was caused during the re-installation process by my vps host providers. It could have happened that the wrong package was sourced/listed and so got pulled into the re-installation process but now I know I was wrong. So I would like to make a special mention to my vps host providers Contabo. I also use other vps host providers so I can tell you the team at Contabo is pretty good. They are easily reachable by phone if needed (some vps providers are not), they did not ‘dismiss my assertions’ and they also agreed to proactively amend their documentation of the fact that CentOS now ships MariaDB instead of Mysql going forward. For anyone who is interested in getting a vps server, I have included a screenshot below of my control panel, it is clean and simple.

contabo-control-panel
My Contabo control panel