Ad Widget

Collapse

Cannot connect to the database. Unable to select configuration.

Collapse
This topic has been answered.
X
X
 
  • Time
  • Show
Clear All
new posts
  • CRSTLLV
    Junior Member
    • May 2019
    • 16

    #1

    Cannot connect to the database. Unable to select configuration.

    Hello,

    I'm trying to install zabbix 6.2 + mysql on ubuntu 22.04 LTS.
    I've created database called "zabbix", as well as mysql user "zabbix" with custom password.
    When i log to the myaql with user zabbix, i can see database "zabbix", as well as tables inside it. So database is there, user is there, password is correct as i'm entering mysql with it. But when trying over the frontend webpage to set up zabbix, it says that it can't connect to the database.

    One more thing, i believe maybe initial schema did not worked correctlty, as i get this error:


    zcat /usr/share/doc/zabbix-sql-scripts/mysql/server.sql.gz | mysql -uzabbix -p
    Enter password:
    ERROR 1046 (3D000) at line 1: No database selected

    Any ideas how to solve it?
    Thank you./

    Click image for larger version

Name:	Screenshot 2022-07-08 at 12.58.03.png
Views:	8873
Size:	147.2 KB
ID:	447520
    Click image for larger version

Name:	Screenshot 2022-07-08 at 12.59.38.png
Views:	8719
Size:	352.4 KB
ID:	447521
  • Answer selected by CRSTLLV at 12-07-2022, 11:44.
    Markku
    Senior Member
    Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
    • Sep 2018
    • 1782

    See this: https://www.zabbix.com/forum/zabbix-...616#post447616

    I think I got it working now... I ran SET GLOBAL log_bin_trust_function_creators = 1; at the MySQL server
    Markku

    Comment

    • Atsushi
      Senior Member
      • Aug 2013
      • 2028

      #2
      Please read the documentation carefully. The mysql command you executed doesn't have enough arguments.
      Zabbix is being downloaded over 4 000 000 times every year for a reason. Download and install Zabbix for free and try it yourself!

      Code:
      # zcat /usr/share/doc/zabbix-sql-scripts/mysql/server.sql.gz | mysql -uzabbix -p zabbix

      Comment

      • CRSTLLV
        Junior Member
        • May 2019
        • 16

        #3
        The ony difference in my executed command was skipped password, but as it have -p argument it asks for the password and i'm entering it.
        But to make it correct, i've added the password to the end of my command and now i see this error:


        zcat /usr/share/doc/zabbix-sql-scripts/mysql/server.sql.gz | mysql -uzabbix -p zabbix
        Enter password:
        ERROR 1050 (42S01) at line 1: Table 'role' already exists

        thank you

        Comment

        • Markku
          Senior Member
          Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
          • Sep 2018
          • 1782

          #4
          The "-p zabbix" in your command does not specify a password. The "-p" tells it to ask for the password and "zabbix" is the name of the database.

          Your description of the problem is quite confusing (you said that you saw tables in a database that was just created as an empty database...), so I'll now just assume that you are trying to install Zabbix for the first time.

          Go to the mysql client as root, say "drop database zabbix;" to delete the database.

          Then go to https://www.zabbix.com/download, select your correct selections, and follow the installation instructions exactly as told (using your own passwords of course).

          Markku

          Comment

          • CRSTLLV
            Junior Member
            • May 2019
            • 16

            #5
            Originally posted by Markku
            The "-p zabbix" in your command does not specify a password. The "-p" tells it to ask for the password and "zabbix" is the name of the database.
            Thank you
            That's my fault. i though that 2nd zabbix (after -p) is password my fault, my fault.

            But.. anyways, i did not helped. I've deleted db, created new, granted permissions to user zabbix, but:


            zcat /usr/share/doc/zabbix-sql-scripts/mysql/server.sql.gz | mysql -uzabbix -p zabbix
            Enter password:
            ERROR 1419 (HY000) at line 2119: You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)

            if used with sudo, i got same error:

            sudo zcat /usr/share/doc/zabbix-sql-scripts/mysql/server.sql.gz | mysql -uzabbix -p zabbix
            Enter password:
            ERROR 1419 (HY000) at line 2119: You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)

            Maybe this is mysql and user zabbix permissions? But i've granted with this command:

            grant all privileges on zabbix.* to zabbix@localhost;

            TY.

            Comment

            • Markku
              Senior Member
              Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
              • Sep 2018
              • 1782

              #6
              See this: https://www.zabbix.com/forum/zabbix-...616#post447616

              I think I got it working now... I ran SET GLOBAL log_bin_trust_function_creators = 1; at the MySQL server
              Markku

              Comment

              • CRSTLLV
                Junior Member
                • May 2019
                • 16

                #7
                Thanks. Solved out

                Comment

                Working...