Exercise: SQL Data Management - Working With and Displaying Recor

This is the second exercise in the LPIC-1 Exam 102 course.  It says "If you do not know how to do this please see the "Installing MySQL" lesson under the exam 102 course."   However, I cannot find a lesson with that name.  The only install to that point was using git to run a container with MariaDB.  If it try and follow it with that, I get 

mysqladmin: connect to server at 'localhost' failed

error: 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)'

Check that mysqld is running and that the socket: '/var/lib/mysql/mysql.sock' exists!

Please help me see what I am missing.

  • post-author-pic
    Brandon B

    Hello Gary!

    Normally, you see that error if MySQL has not been started. Try:

    systemctl start mysqld

    If the application has been installed (systemctl status mysqld), you should be able to start the service.

    Let us know if that helps!


  • post-author-pic
    Gary M

    [root@gmorton3 ~]# systemctl start mysqld

    Failed to start mysqld.service: Unit not found.

    [root@gmorton3 ~]#

    [root@gmorton3 ~]#

    [root@gmorton3 ~]# mysql --user=root --password=password123 --host=

    Welcome to the MariaDB monitor. Commands end with ; or \g.

    Your MySQL connection id is 10

    Server version: 5.7.23 MySQL Community Server (GPL)

    Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

    Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

    MySQL [(none)]>

  • post-author-pic
    Gary M

    This is the instruction to follow: "At the Linux command line perform the following commands:

    1) First Reset the root mysql password

    mysqladmin -u root -p password '123456'"

    When I do that,  the password above does not work when it asks.  

    The Solution says "NOTE: After installing the DB Server, you will have to obtain the default root password for the DB from /var/log/mysqld.log in order to complete the exercise below:Installing The Exercise Data"

    But there is no /var/log/mysqld.log file.   It seems there needs to be another install of the database that is not in the container maybe?  But I can't find the lesson it refers to "Installing MySQL".

  • post-author-pic
    Gary M

    I figured out that there is another course called "SQL Primer".  The second video "Create databases" had the information to get this installed directly to the lab server, not in a container and allowed me to complete this lab.  I guess things were reorganized and renamed and the doumentation for the lab was not updated.

Looking For Team Training?

Learn More