MariaDB Troubleshooting KodeKloud






Task: After digging the issue team found that mariadb is down on the database server. Fix the issue.

Solution:

Login to database server: ssh peter@stdb01

Login as root: sudo su

Install mysql: yum install mysql


Start mariadb and check status:
systemctl start mariadb
systemctl status mariadb



Download Coding Interview Book and Get More Tutorials for Coding and Interview Solution: Click Here

Download System Design Interview Book and Get More Tutorials and Interview Solution: Click Here

Do you need more Guidance or Help? Then Book 1:1 Quick Call with Me: Click Here

Share on Google Plus

About Ashadullah Shawon

I am Ashadullah Shawon. I am a Software Engineer. I studied Computer Science and Engineering (CSE) at RUET. I Like To Share Knowledge. Learn More: Click Here
    Blogger Comment
    Facebook Comment

12 comments:

  1. It worked. But how to figure out the issue ? I mean how u know mysql is not installed?

    ReplyDelete
    Replies
    1. You can check the status at first by this command systemctl status mariadb. Then you can find the issue.

      Delete
  2. Hi, thanks for the solution. I executed the command systemctl status mariadb, but I didn't find the problem with mysql. I searched how install mariadb, but the one reference that i am found was this:

    sudo mysql_secure_installation

    I tried with your steps by steps and it solutionated.
    This line "yum install mysql" why is necessary?
    Sorry I am not too experience in linux.

    ReplyDelete
    Replies
    1. Because the existing mysql service is corrupted. That's why you need to re install or update it.

      Delete
  3. No need to install anything
    Just locate mysql files, in /usr/bin/ & /etc/ & /var/lib . And then change the ownership of the files to chown mysql:mysql . And then start the service. service mariadb start. It will start successfully.

    ReplyDelete
  4. journalctl -xe | grep mariadb
    Change ownership of mysql.
    chown -R mysql:mysql /var/lib/mysql
    systemctl enable mariadb
    sytemctl start mariadb
    systemctl status mariadb

    ReplyDelete
    Replies
    1. Thanks a lot. I did everything but Icouldnt be success."chown -R mysql:mysql /var/lib/mysql"this command provided success for me..

      Delete
  5. Interesting you guys. Thanks for all the contributions

    ReplyDelete
  6. I just installed mysql using yum.
    Started and enabled the mariadb service and it worked for me. Thanks Shawonruet

    ReplyDelete
  7. the answer varies.
    for some the below works

    mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql
    sudo systemctl start mariadb.servic

    ReplyDelete