On a Centos 8 server I'm trying to install MariaDB and MySQL.
I have used this command
dnf install mariadb-server mariadb -y
mysql-community-server-5.7.40-1.el7.x86_64 was installed after that.
Now, If i run
systemctl start mariadb
It says
Failed to start mariadb.service: Unit mariadb.service not found.
Along with php I have installed php-mysql module, so I have mysqld.service but its status is also showing following error
mysql -v shows following error
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
Additional Info:
Output of dnf repolist
| repo id | repo name |
|---|---|
| appstream | CentOS Stream 8 - AppStream |
| baseos | CentOS Stream 8 - BaseOS |
| epel | Extra Packages for Enterprise Linux 8 - x86_64 |
| epel-modular | Extra Packages for Enterprise Linux Modular 8 - x86_64 |
| epel-next | Extra Packages for Enterprise Linux 8 - Next - x86_64 |
| extras | CentOS Stream 8 - Extras |
| extras-common | CentOS Stream 8 - Extras common packages |
| mysql-connectors-community | MySQL Connectors Community |
| mysql-tools-community | MySQL Tools Community |
| mysql57-community | MySQL 5.7 Community Server |
| remi-modular | Remi's Modular repository for Enterprise Linux 8 - x86_64 |
| remi-safe | Safe Remi's RPM repository for Enterprise Linux 8 - x86_64 |
Output of command dnf info mariadb-server mysql-server mysql-community-server
Output of command systemctl start mysqld:
Job for mysqld.service failed because the control process exited with error code. See "systemctl status mysqld.service" and "journalctl -xe" for details.
Note: I'm trying to setup an existing project which has its DB in mysql 5.7 so I want to install same version.



mysql-community-serveris available in the CentOS 8 repositories. The minimum version ofmysql-serverfor CentOS 8 should be v8.0 and not v5.7. Running the commanddnf install mariadb-server mariadbshould have installed themariadb-serverandmariadbpackages with version 10.x and should not installmysqlpackages. Please add the output ofdnf repolistanddnf info mariadb-server mysql-server mysql-community-serverto your question to hopefully straighten things out.mysql-community-serverv5.7 then I am not sure why you mentionedmariadbin your post. The error then is that yourmysqlserver is not starting. To startmysql-community-serveryou would runsystemctl start mysqld. If that does not work, then post the MySQL error logs.