Ad Widget

Collapse

Installing and stuck at "Create initial database" - unable to log in.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rgibbons
    Junior Member
    • Jun 2020
    • 4

    #1

    Installing and stuck at "Create initial database" - unable to log in.

    Installing Zabbix 5.0 using Ubuntu 20.04 with MySQL and Apache.

    Clean install on new system.

    Section 2.c: create initial database. I get the following when trying to log in to mysql: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
    Click image for larger version

Name:	mysql_error.png
Views:	10363
Size:	2.8 KB
ID:	405242
    The mysqld directory doesn't exist. Did the install command from the previous section (2.b) fail?

    I did set the root user password and used that in the command above.

    Thanks for the patience and help in learning.
    Attached Files
  • tim.mooney
    Senior Member
    • Dec 2012
    • 1427

    #2
    You have a typo in the "cd" command you showed, you missed the 'q' in "mysqld". So whether "/var/run/mysqld" exists or not is still an unknown.

    When the 'mysql' command-line client can't connect through a local socket like that, it's usually one of two issues:
    1. the mysqld server isn't running, so it hasn't created the local-access socket
    2. the client and the server config don't agree about where the socket is, so the server has created it (somewhere) but the client is using a different path and not finding it.
    It's not impossible that it's some other (less common) problem, but it's usually one of these two things.

    This MySQL issue is completely unrelated to the previous steps. Whether the packages installed correctly doesn't impact the initial creation of the database.

    Comment

    • rgibbons
      Junior Member
      • Jun 2020
      • 4

      #3
      Thanks for the response!

      I checked the /var/run folder and there is no mysql or mysqld folder in there.
      Click image for larger version

Name:	mysql_error1.png
Views:	10359
Size:	35.4 KB
ID:	405367
      I also tried starting the service, but it was not found.

      In thinking that maybe MySQL was not installed successfully, I just tried reinstalling using the command below as shown in the install guide.
      Code:
      sudo apt install zabbix-server-mysql
      It returned the following:
      zabbix-server-mysql is already the newest version (1:5.0.2-1+focal).
      0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.

      Another thing I neglected to mention in my initial post is that I did perform all available upgrades to the Ubuntu 20.04 OS prior to starting the Zabbix install.

      Comment

      • tim.mooney
        Senior Member
        • Dec 2012
        • 1427

        #4
        Originally posted by rgibbons
        I checked the /var/run folder and there is no mysql or mysqld folder in there.

        I also tried starting the service, but it was not found.

        In thinking that maybe MySQL was not installed successfully, I just tried reinstalling using the command below as shown in the install guide.
        Code:
        sudo apt install zabbix-server-mysql
        The "zabbix-server-mysql" doesn't actually install mysql; it installs the zabbix-server component built to use MySQL as the backend database. You essentially need to install MySQL or MariaDB or Percona separately. Many sites will run the database server on the same host as zabbix-server, but to accommodate larger sites or sites that just need to separate the DB from the other components, Zabbix doesn't assume that MySQL/MariaDB/Percona is installed on the same system. It might be on another system on the network. In this way, providing a running MySQL instance is "left as an exercise for the reader", so to speak.

        So, you have the zabbix-server that's ready to use MySQL (either locally or on a remote host), after configuring DB-related settings in zabbix-server.conf, but you don't yet have a MySQL server installed and running. You need to take care of that step, before you can proceed.

        Comment

        Working...