Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-28390

Resetting the password causes A LOT OF troube^

    XMLWordPrintable

Details

    Description

      I've used MariaDB for a long time and it is really great for a lot of use cases. But when a user forgets the password, it really gets annoying quickly.
      There are tons of different tutorials on how to reset it, but none work.

      I've tried several versions of these scripts:

      #!/bin/bash
       
      set -x
       
      sudo killall -9 mysqld_safe mysqld mariadb mariadbd
       
      sudo service mysqld stop
       
      sudo mysqld_safe --skip-grant-tables &
       
      sleep 5
       
      echo 'FLUSH PRIVILEGES; ALTER USER "root"@"localhost" IDENTIFIED BY "mynewpassword"; FLUSH PRIVILEGES;' | mysql -uroot
       
      sleep 5
       
      sudo killall -9 mysqld_safe mysqld mariadb mariadbd
       
      if [[ -e /var/lib/mysql/aria_log_control_OLD ]]; then
          sudo rm /var/lib/mysql/aria_log_control_OLD
      fi
      sudo mv /var/lib/mysql/aria_log_control /var/lib/mysql/aria_log_control_OLD
       
      sudo service mysqld start
      
      

      set -x
      sudo service mysqld stop
      sudo apt-get -y purge mariadb-server
      sudo rm -rf /var/lib/mysql
      sudo apt-get -y install --reinstall mariadb-server
      sudo mkdir /var/lib/mysql/
      sudo killall -9 mysqld mariadbd mysqld mysql mysqld_safe
      sudo service mariadb start
      sudo mysqld_safe --skip-grant-tables &                  
      sudo mysql_install_db --user=mysql
      sudo mysql_secure_installation
      

       

      and a lot of more stuff.

      But nothing works anymore. I cannot even re-initialize the /var/lib/mysql directory. This NEEDS to be a simple call. mariadb_reinit_mysql_data_dir and done. Empty installation, just like after a fresh format of the system. No more questions asked.

      There has to be an official documentation that just works. Maybe even a mariadb_forgot_password program that does all of the heavy lifting.

      I have several computers which I had to re-install the whole OS or abandon development on because I could not figure out how to properly reset the password. There isn't even a way of re-initializing the /var/lib/mysql directory that just works. All of them plainly suck.

      This may very well be my own fault, of course, but the lack of official documentation (or at least the impossibility of finding it) on this problem makes it REALLY annoying. Every page that comes up at google does these things differently, but none work, and after trying each of them the problem progressively gets worse all the time.

      Attachments

        Activity

          People

            greenman Ian Gilfillan
            NK93 Norman Koch
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.