• Recent
    • Unsolved
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Upgrade to FOG 1.0.1- Unable to Connect to Database

    Scheduled Pinned Locked Moved
    FOG Problems
    9
    20
    7.6k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • G
      GBison
      last edited by

      When I type the command

      [CODE]mysql -u root -p’<YOURMYSQLPASSWORD>’ -h<FOGSERVERIP> fog[/CODE]

      in terminal, it asks for my password (I’m assuming SQL password, which is blank, so I just hit ENTER.
      It returns with

      ERROR 2003 (HY000): Can’t connect to MySQL server on ‘192.168.11.241’ (111)

      I typically sudo commands, so I’m not used to changing to root. It’s very possible I just mistyped the command, or forgot my root password if that’s the one it’s asking for.

      I remember the old section of “MYSQLPASSWORD” in one of the config.php files, but since these settings have been consolidated to elsewhere I’m not sure where to look to make sure my settings are correct as far as passwords and usernames are concerned (I’ve made a few FOG machines, so I have some trouble remembering the UN and Pass for each sometimes).

      1 Reply Last reply Reply Quote 0
      • G
        GBison
        last edited by

        Also, during the install of 1.0.1 it never prompted me to type in a new MySQL password or confirm my existing one. The whole setup was automatic minus the two Y/N choices and the enter to confirm settings (which were all correct).

        1 Reply Last reply Reply Quote 0
        • Tom ElliottT
          Tom Elliott
          last edited by

          ERROR 2003 (HY000): Can’t connect to MySQL server on ‘192.168.11.241’

          That message is saying it’s not allowing connection. You may need to comment out the bind-address portion of the my.cnf file.

          Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG! Get in contact with me (chat bubble in the top right corner) if you want to join in.

          Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

          Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

          1 Reply Last reply Reply Quote 0
          • G
            GBison
            last edited by

            After remembering the root password for the machine, the code generated the SQL version and the listing of commands that are possible. It then listed variables below:

            [CODE]Variables (–variable-name=value)
            and boolean options {FALSE|TRUE} Value (after reading options)


            auto-rehash TRUE
            auto-vertical-output FALSE
            character-sets-dir (No default value)
            column-type-info FALSE
            comments FALSE
            compress FALSE
            debug-check FALSE
            debug-info FALSE
            database (No default value)
            default-character-set auto
            delimiter ;
            enable-cleartext-plugin FALSE
            vertical FALSE
            force FALSE
            named-commands FALSE
            ignore-spaces FALSE
            init-command (No default value)
            local-infile FALSE
            no-beep FALSE
            host 192.168.11.241
            html FALSE
            xml FALSE
            line-numbers TRUE
            unbuffered FALSE
            column-names TRUE
            sigint-ignore FALSE
            port 3306
            prompt mysql>
            quick FALSE
            raw FALSE
            reconnect TRUE
            socket /var/run/mysqld/mysqld.sock
            ssl FALSE
            ssl-ca (No default value)
            ssl-capath (No default value)
            ssl-cert (No default value)
            ssl-cipher (No default value)
            ssl-key (No default value)
            ssl-verify-server-cert FALSE
            table FALSE
            user root
            safe-updates FALSE
            i-am-a-dummy FALSE
            connect-timeout 0
            max-allowed-packet 16777216
            net-buffer-length 16384
            select-limit 1000
            max-join-size 1000000
            secure-auth FALSE
            show-warnings FALSE
            plugin-dir (No default value)
            default-auth (No default value)
            [/CODE]

            And where would I find the my.cnf file you suggested?

            1 Reply Last reply Reply Quote 0
            • A
              Albatros
              last edited by

              Take a look here
              /etc/my.cnf or /etc/mysql/my.cnf

              Edit:
              And there is a nice command named locate.
              [CODE]locate my.cnf[/CODE]

              1 Reply Last reply Reply Quote 0
              • G
                GBison
                last edited by

                I commented out the bind-address command which was set to the default 127.0.0.1. I restarted the mysql service and nothing changed. Went ahead and uncommented it so that I’m back to initial state.

                P.S Thanks for the locate command tip

                1 Reply Last reply Reply Quote 0
                • G
                  GBison
                  last edited by

                  Fixed!

                  Turns out it was completely my error. In the new config.php file, it had DATABASE_USERNAME already set as root, and password blank. I assumed this was correct and pulled from the previous configuration of FOG. HOWEVER, I didn’t realize it was asking for the machine root user password and NOT the SQL password. I’m not sure if this was caused by something I did, or if the new config.php doesn’t (can’t?) update this information from a previous install.

                  In the var/www/fog/commons/config.php file, I typed the password for the machine’s root user in the DATABASE_PASSWORD field. My DATABASE_USERNAME was automatically filled with root. I then restarted the MySQL service and was able to log on to the management console and do the upgrade.

                  So, in reality my issue was with the root user credentials located in var/www/fog/commons/config.php, and NOT with the SQL creds. Again, not sure if this was my error or just how the new install pulls its info from previous builds.

                  In any case, give this a shot and see if it helps.

                  1 Reply Last reply Reply Quote 0
                  • JunkhackerJ
                    Junkhacker Developer
                    last edited by

                    The config.php file IS asking for the MySQL root user password, NOT the computer root user password
                    i think maybe you have your passwords documented wrong, or you set the computer root password and the mySQL root password to the same thing

                    signature:
                    Junkhacker
                    We are here to help you. If you are unresponsive to our questions, don't expect us to be responsive to yours.

                    1 Reply Last reply Reply Quote 0
                    • G
                      GBison
                      last edited by

                      That may be true, sorry for misinformation.

                      Like I said before, I’ve built a few of these fog servers, so I sometimes get the passwords and such mixed up between them all.

                      1 Reply Last reply Reply Quote 0
                      • JunkhackerJ
                        Junkhacker Developer
                        last edited by

                        a bit of advice on passwords. keepass. it’s a free encrypted database designed for storing password information. i use dropbox to keep my password database synchronized across multiple machines.

                        signature:
                        Junkhacker
                        We are here to help you. If you are unresponsive to our questions, don't expect us to be responsive to yours.

                        1 Reply Last reply Reply Quote 0
                        • A
                          amiller
                          last edited by

                          [quote=“Reuben Bannister, post: 27439, member: 24266”]Im also having the same problem’s. I’ve reinstalled my Ubuntu about 20 times on site on Friday pulling my hair out!

                          Hopefully they will get this sorted asap as this was my first time using the software and Im clueless about Linux as well so having to install Ubuntu Workstation then think it was something i was doing wrong to then install Server and find the same issues. Watched the install videos over and over.

                          This seems to help If I run ‘sudo service mysql stop’, then ‘sudo service MySQL start’, everything works perfectly until next reboot.[/quote]

                          I too am having this problem and this solution works (at least temporarily).

                          1 Reply Last reply Reply Quote 0
                          • 1 / 1
                          • First post
                            Last post

                          134

                          Online

                          12.1k

                          Users

                          17.3k

                          Topics

                          155.4k

                          Posts
                          Copyright © 2012-2024 FOG Project