Question

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

Posted December 10, 2017 4.3k views
CentOSMySQLMariaDB

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.x8664
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?

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.

×
Submit an Answer
1 answer

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/mariadb.pid --socket=/var/lib/mysql/mysql.sock

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

https://www.digitalocean.com/community/tutorials/how-to-install-mariadb-on-centos-7

https://www.digitalocean.com/community/tutorials/how-to-import-and-export-databases-in-mysql-or-mariadb

I hope this helps!

Regards,
Rajkishore

by Melissa Anderson
MariaDB is an open-source database management system, commonly installed as part of the popular LEMP stack. In this tutorial, we will explain how to install the latest version of MariaDB on a CentOS 7 server. If you specifically need MySQL, see the [How to Install MySQL on CentOS 7](https://www.digitalocean.com/community/tutorials/how-to-install-mysql-on-centos-7) guide. If you're wondering about MySQL vs. MariaDB, MariaDB is the preferred package and in general will work seamlessly in place