Ad Widget

Collapse

Clarification on Zabbix/mysql and -uroot password

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • n01k
    Junior Member
    • May 2021
    • 7

    #1

    Clarification on Zabbix/mysql and -uroot password

    Hello everyone,

    I am looking to setup Zabbix at home and play with it a bit. I've used it many years ago and now looking to get back into it with a fresh new build.

    I have Ubuntu 24.04 and I've chosen to start with mysql and apache.

    During the configuration phase, I'm not clear on the following:

    Download and install Zabbix for Ubuntu

    Code:
    # mysql -uroot -p
    password
    mysql> create database zabbix character set utf8mb4 collate utf8mb4_bin;
    mysql> create user zabbix@localhost identified by 'password';
    mysql> grant all privileges on zabbix.* to zabbix@localhost;
    mysql> set global log_bin_trust_function_creators = 1;
    mysql> quit;

    Code:
    # mysql -uroot -p
    password
    mysql> set global log_bin_trust_function_creators = 0;
    mysql> quit;

    Code:
    DBPassword=password
    The above steps start off with mysql -uroot -p and password

    I assume that since the instructions are telling me to run the following commands, that I'm using password as the password? or should I be setting my own password here?

    When I try to set my own password, I run into an error for this command:

    Click image for larger version

Name:	image.png
Views:	113
Size:	16.7 KB
ID:	512182

    I entered in the password from the start of section d. commands for mysql and I get this error.

    Click image for larger version

Name:	image.png
Views:	10
Size:	7.6 KB
ID:	512183

    So I'm not sure why this is the case. Maybe to me, its not clear that I am supposed to set a new password or use a default password for mysql, since al lit asks is "Enter Password"

    Click image for larger version

Name:	image.png
Views:	10
Size:	3.9 KB
ID:	512184


    I know this is a bit of a stupid question and at times I can overthink things hah
    Just wanted an understanding as I try to read each line and understand what it will be doing.

    Thank you
  • hrrapozo
    Junior Member
    • Nov 2025
    • 7

    #2
    When you do the mysql -uroot -p command the password for that is what you use when you do the sudo command (in which case it would the password to your user account on the computer).

    For the line that says:

    mysql> create user zabbix@localhost identified by 'password'

    That password is what you want to use for the zabbix SQL user which needs to match the parameter DBPassword in the zabbix_server.conf file located in /var/zabbix


    Comment

    • n01k
      Junior Member
      • May 2021
      • 7

      #3
      Originally posted by hrrapozo
      When you do the mysql -uroot -p command the password for that is what you use when you do the sudo command (in which case it would the password to your user account on the computer).

      For the line that says:

      mysql> create user zabbix@localhost identified by 'password'

      That password is what you want to use for the zabbix SQL user which needs to match the parameter DBPassword in the zabbix_server.conf file located in /var/zabbix


      Thank you for the explanation. I'm surprised that this isn't more clearly identified in the Zabbix instructions, unless this is all common knowledge and I'm the issue here.

      I will give it a try this evening. Thank you

      Comment

      Working...