0

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

screenshot of systemctl status mysqld.service command

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

Image: 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.

Output of command "systemctl status mysqld"

Note: I'm trying to setup an existing project which has its DB in mysql 5.7 so I want to install same version.

9
  • Your screenshot shows no error, as far as I can tell. What's wrong with it? Commented Jan 9, 2023 at 1:34
  • I do not see that mysql-community-server is available in the CentOS 8 repositories. The minimum version of mysql-server for CentOS 8 should be v8.0 and not v5.7. Running the command dnf install mariadb-server mariadb should have installed the mariadb-server and mariadb packages with version 10.x and should not install mysql packages. Please add the output of dnf repolist and dnf info mariadb-server mysql-server mysql-community-server to your question to hopefully straighten things out. Commented Jan 9, 2023 at 19:41
  • @MarcusMüller error is this "ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)". Commented Jan 10, 2023 at 8:02
  • @GracefulRestart I have added the output commands you mentioned on the post. Please review. Commented Jan 10, 2023 at 8:05
  • If you meant to install mysql-community-server v5.7 then I am not sure why you mentioned mariadb in your post. The error then is that your mysql server is not starting. To start mysql-community-server you would run systemctl start mysqld. If that does not work, then post the MySQL error logs. Commented Jan 11, 2023 at 7:23

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.