Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Not a Bug
    • Affects Version/s: 10.0.21
    • Fix Version/s: N/A
    • Component/s: Scripts & Clients
    • Labels:
    • Environment:
      FC22

      Description

      I have followed all the steps using mysqld_safe or mysql_secure_installation to try to set (or reset) the root password. I have tried to set it to my preferred password, and to blank. I have tried simple user "root", "root@localhost", and "root@127.0.0.1" singly and in all combinations. The only response I ever get after performing all these steps is "Access denied" either using password YES or NO. This completely prevents me from using the software.

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            elenst Elena Stepanova added a comment - - edited

            Stan Walker,

            "all the steps" is not particularly helpful for understanding what the problem is.
            Could you explain what you had, what you are trying to do, and how you are trying to do it?

            • you've set "affects versions" to Galera, is it really what you are using? If so, do you work on a single node, or do you have a cluster already?
            • are you installing MariaDB on a clean machine, or did you have an installation before but don't have a password to it?
            • since you specified Documentation as a component, I assume you are following instructions in MariaDB KB, could you please paste the link which you are using?

            As a very short approach, without knowing all the details above, I would suggest

            • add skip-grant-tables to your cnf file;
            • restart the server;
            • connect as -uroot without a password;
            • set the desired password;
            • run FLUSH PRIVILEGES;
            • connect again using the password;
            • remove skip-grant-tables from the cnf file;
            • restart the server;
            • make sure you still can connect with the password.

            If it does not work, please describe when exactly it fails, and what the failure looks like, and also attach your server error log.

            Show
            elenst Elena Stepanova added a comment - - edited Stan Walker , "all the steps" is not particularly helpful for understanding what the problem is. Could you explain what you had, what you are trying to do, and how you are trying to do it? you've set "affects versions" to Galera, is it really what you are using? If so, do you work on a single node, or do you have a cluster already? are you installing MariaDB on a clean machine, or did you have an installation before but don't have a password to it? since you specified Documentation as a component, I assume you are following instructions in MariaDB KB, could you please paste the link which you are using? As a very short approach, without knowing all the details above, I would suggest add skip-grant-tables to your cnf file; restart the server; connect as -uroot without a password; set the desired password; run FLUSH PRIVILEGES ; connect again using the password; remove skip-grant-tables from the cnf file; restart the server; make sure you still can connect with the password. If it does not work, please describe when exactly it fails, and what the failure looks like, and also attach your server error log.
            Hide
            sswalker Stan Walker added a comment -

            First' the steps;

            Shutdown the server.
            mysqld_safe --skip-grant-tables --skip-syslog --skip-networking
            mysql -u root
            Then, either with or without "use mysql;"
            UPDATE mysql.user SET Password=PASSWORD('password') WHERE User='root';
            FLUSH PRIVILEGES;
            \q
            mysqladmin shutdown
            And I get "Access denied" with or without -u root or using a password.

            If I try to use "SET PASSWORD FOR root@localhost=PASSWORD('');" I get:
            ERROR 1290 (HY000): The MariaDB server is running with the --skip-grant-tables option so it cannot execute this statement

            As for which version, when I do mysql -u root it replies:
            "Welcome to the MariaDB monitor. Commands end with ; or \g.
            Your MariaDB connection id is 2
            Server version: 10.0.21-MariaDB MariaDB Server"

            Single machine, fresh install with a fresh install of FC22.

            Your suggestion didn't make any difference.

            I used "Documentation" just because I couldn't find any help in any documentation and have no idea where the problem lies.

            Where would I find the server error log?

            Show
            sswalker Stan Walker added a comment - First' the steps; Shutdown the server. mysqld_safe --skip-grant-tables --skip-syslog --skip-networking mysql -u root Then, either with or without "use mysql;" UPDATE mysql.user SET Password=PASSWORD('password') WHERE User='root'; FLUSH PRIVILEGES; \q mysqladmin shutdown And I get "Access denied" with or without -u root or using a password. If I try to use "SET PASSWORD FOR root@localhost=PASSWORD('');" I get: ERROR 1290 (HY000): The MariaDB server is running with the --skip-grant-tables option so it cannot execute this statement As for which version, when I do mysql -u root it replies: "Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 2 Server version: 10.0.21-MariaDB MariaDB Server" Single machine, fresh install with a fresh install of FC22. Your suggestion didn't make any difference. I used "Documentation" just because I couldn't find any help in any documentation and have no idea where the problem lies. Where would I find the server error log?
            Hide
            elenst Elena Stepanova added a comment -

            Stan Walker:

            I did not get the last part of "the steps".
            Do you get 'Access denied' before you shutdown the server or after you restarted it?

            When you connect to the server running with skip-grant-tables, run

            - CHECK TABLE mysql.user; -- to make sure the table is not corrupted;
            - UPDATE mysql.user SET password='' WHERE user='root'; -- that is, set it to the empty value explicitly;
            - SELECT user, host, password FROM mysql.user WHERE user='root'; -- to make sure you have local roots there, and that your update worked;
            - SELECT @@log_error; -- to know where your error log is;
            - FLUSH PRIVILEGES;
            
            • disconnect;
            • do not restart the server just yet, try to reconnect to it without a password;
            • if you succeed, run SELECT current_user(); to know for sure which root you are, then restart the server and try again;
            • otherwise please quote the exact error message (which starts with Access denied for user, but it's the user name that is interesting in there.

            Find your error log by the path you selected as @@log_error.

            Show
            elenst Elena Stepanova added a comment - Stan Walker : I did not get the last part of "the steps". Do you get 'Access denied' before you shutdown the server or after you restarted it? When you connect to the server running with skip-grant-tables , run - CHECK TABLE mysql.user; -- to make sure the table is not corrupted; - UPDATE mysql.user SET password='' WHERE user='root'; -- that is, set it to the empty value explicitly; - SELECT user, host, password FROM mysql.user WHERE user='root'; -- to make sure you have local roots there, and that your update worked; - SELECT @@log_error; -- to know where your error log is; - FLUSH PRIVILEGES; disconnect; do not restart the server just yet, try to reconnect to it without a password; if you succeed, run SELECT current_user(); to know for sure which root you are, then restart the server and try again; otherwise please quote the exact error message (which starts with Access denied for user , but it's the user name that is interesting in there. Find your error log by the path you selected as @@log_error .
            Hide
            sswalker Stan Walker added a comment - - edited

            I get the error on trying to shutdown. At that point the only way I can stop it is to kill it.

            Doing as you suggested, CHECK TABLE returned:

            +------------+-------+----------+----------+
            | Table      | Op    | Msg_type | Msg_text |
            +------------+-------+----------+----------+
            | mysql.user | check | status   | OK       |
            +------------+-------+----------+----------+
            1 row in set (0.00 sec)
            
            SELECT user ... returned:
            Empty set (0.00 sec)
            
            And the Access denied error in its entirety is:
            ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
            

            The user is always the same.

            I also followed the steps above but first doing "use mysql;" but the results were identical.

            When I looked at the log, at the bottom was the line:

            "150927 17:40:17 [ERROR] Missing system table mysql.proxies_priv; please run mysql_upgrade to create it"
            

            So I tried doing that. When I just loaded the server, I got access denied. When I instead used skip_grant_tables, it would run, but there were lots of errors (see attached log). It seems that, aside from many files having the wrong structure, there is also at least one file missing at ./mysql/proc.MYI.

            Hoping this helps! mariadb.log

            Show
            sswalker Stan Walker added a comment - - edited I get the error on trying to shutdown. At that point the only way I can stop it is to kill it. Doing as you suggested, CHECK TABLE returned: +------------+-------+----------+----------+ | Table | Op | Msg_type | Msg_text | +------------+-------+----------+----------+ | mysql.user | check | status | OK | +------------+-------+----------+----------+ 1 row in set (0.00 sec) SELECT user ... returned: Empty set (0.00 sec) And the Access denied error in its entirety is: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) The user is always the same. I also followed the steps above but first doing "use mysql;" but the results were identical. When I looked at the log, at the bottom was the line: "150927 17:40:17 [ERROR] Missing system table mysql.proxies_priv; please run mysql_upgrade to create it" So I tried doing that. When I just loaded the server, I got access denied. When I instead used skip_grant_tables, it would run, but there were lots of errors (see attached log). It seems that, aside from many files having the wrong structure, there is also at least one file missing at ./mysql/proc.MYI. Hoping this helps! mariadb.log
            Hide
            elenst Elena Stepanova added a comment - - edited

            Something very bad happened to your data directory. Possibly there were some remains of an old one on the machine, or maybe cleanup failed to happen, or something.
            Running SELECT user, host FROM mysql.user (now without WHERE user='root' clause) might give you a clue, if it returns some names which you might recognize. You don't need to paste results here (and should not), it's just for you.

            Anyway, not only some system tables are missing and some have an old structures, but also some system data is missing. Since you don't have any root users, quite obviously you won't be able to connect as one. mysql_upgrade won't help here.

            I recommend re-running mysql_install_db. Since you expected it to be a clean installation, there should be no data that you would lose; just erase the contents of your datadir /var/lib/mysql/* (but better keep the empty folder itself). If you are unsure whether there is anything potentially useful for you, make a backup first.
            After that run mysql_install_db --user=mysql (under sudo or system root). If it succeeds, start the server (without skip-grant-tables) and check that you can connect without a password.

            If mysql_install_db fails, please paste the errors.

            Show
            elenst Elena Stepanova added a comment - - edited Something very bad happened to your data directory. Possibly there were some remains of an old one on the machine, or maybe cleanup failed to happen, or something. Running SELECT user, host FROM mysql.user (now without WHERE user='root' clause) might give you a clue, if it returns some names which you might recognize. You don't need to paste results here (and should not), it's just for you. Anyway, not only some system tables are missing and some have an old structures, but also some system data is missing. Since you don't have any root users, quite obviously you won't be able to connect as one. mysql_upgrade won't help here. I recommend re-running mysql_install_db. Since you expected it to be a clean installation, there should be no data that you would lose; just erase the contents of your datadir /var/lib/mysql/* (but better keep the empty folder itself). If you are unsure whether there is anything potentially useful for you, make a backup first. After that run mysql_install_db --user=mysql (under sudo or system root). If it succeeds, start the server (without skip-grant-tables) and check that you can connect without a password. If mysql_install_db fails, please paste the errors.
            Hide
            sswalker Stan Walker added a comment -

            Thank you!! That fixed it!
            I don't know what could have happened. Like I said, it was a fresh install, reformatted drive, etc. There is no way there was old data there.
            I never have simple problems when I ask for help. If it was simple, I wouldn't NEED the help.

            Thank you again.

            Show
            sswalker Stan Walker added a comment - Thank you!! That fixed it! I don't know what could have happened. Like I said, it was a fresh install, reformatted drive, etc. There is no way there was old data there. I never have simple problems when I ask for help. If it was simple, I wouldn't NEED the help. Thank you again.
            Hide
            elenst Elena Stepanova added a comment -

            No problem, things happen.
            mysql_install_db is executed when packages are being installed, maybe something went wrong at that moment and the database ended up in a dirty state.
            Good to know it works now, hope it will stay this way.
            Good luck!

            Show
            elenst Elena Stepanova added a comment - No problem, things happen. mysql_install_db is executed when packages are being installed, maybe something went wrong at that moment and the database ended up in a dirty state. Good to know it works now, hope it will stay this way. Good luck!

              People

              • Assignee:
                Unassigned
                Reporter:
                sswalker Stan Walker
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: