Centos 7, MySQL cannot start and is not running, but can be accessed and can't be uninstalled?

I recently restarted a server that I’ve inherited (and therefore didn’t set up). Before the restart the webpages were accessing their SQL databases just fine — through MariaDB to a remote server. On the restart, they can no longer access their databases and the problem seems to be that MySQL/MariaDB isn’t running.

‘yum systemctl start mariadb’ brings up the error “Failed to start mariadb.service: Unit not found.” Strangely enough, I can still access the mysql shell with ‘mysql -u <user> -p’ and commands in the shell seem to work just fine — but my webpages can’t access the databases.

When I try to uninstall and reinstall I get the error:

maraidb101u-common conflicts with 1:mariadb-libs-5.5.56-2el7.x86_64 maraidb101u-config conflicts with 1:mariadb-libs-5.5.56-2el7.x86_64 maraidb101u-libs conflicts with 1:mariadb-libs-5.5.56-2el7.x86_64

I can’t make a backup with mysqldump either, so I’m trying to tread carefully. Does anyone have any idea of what can be done to troubleshoot this?


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hi @jkaywallace,

I tried to recreate the error which you are seeing but systemctl start mariadb worked for me without any error.

[root@mariadbcentos7-s-1vcpu-1gb-nyc1-01 ~]# systemctl start mariadb
[root@mariadbcentos7-s-1vcpu-1gb-nyc1-01 ~]# systemctl status mariadb
● mariadb.service - MariaDB database server
   Loaded: loaded (/usr/lib/systemd/system/mariadb.service; disabled; vendor preset: disabled)
   Active: active (running) since Tue 2021-10-26 13:27:34 UTC; 4min 59s ago
  Process: 1606 ExecStartPost=/usr/libexec/mariadb-wait-ready $MAINPID (code=exited, status=0/SUCCESS)
  Process: 1523 ExecStartPre=/usr/libexec/mariadb-prepare-db-dir %n (code=exited, status=0/SUCCESS)
 Main PID: 1605 (mysqld_safe)
   CGroup: /system.slice/mariadb.service
           ├─1605 /bin/sh /usr/bin/mysqld_safe --basedir=/usr
           └─1770 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --log-error=/var/log/mariadb/mariadb.log --pid-file=/var/run/mariadb/ --socket=/var/lib/mysql/mysql.sock

You can check the below tutorial to guide you with Mariadb installation and backup :

I hope this helps!

Regards, Rajkishore