Kali Linux 2020 Reset MySQL/MariaDB root Password

February 19, 2020 | By the+gnu+linux+evangelist | Filed in: Tutorial.

Reset MySQL/MariaDB 5.7+ root Password Kali Linux 2020

Hi! The Tutorial Shows You Step-by-Step How to Reset MySQL/MariaDB 5.7+ root User Password in Kali 2020 GNU/Linux Desktop/Server.

And I’ve tried to Reset MySQL root Pass on Kali Linux 2020 in many Ways but this was the Only one Working Solution!

How to Install MySQL Workbench in Kali Linux 2020 - Featured
  1. First, Try to Recover Default Password
    Look into the Default MySQL Config file:

    sudo cat /etc/mysql/debian.cnf
    Then Try to Login with the Given Pass.
  2. Stop MySQL Server

    sudo service mysql stop
    Or in case:
    sudo service mariadb stop
  3. Make the Needed Directory

    sudo mkdir /var/run/mysqld

    And Set mysql as User

    sudo chown mysql: /var/run/mysqld
  4. Start mysqld_safe

    sudo mysqld_safe --skip-grant-tables --skip-networking &
  5. Login into MySQL without Pass
    Open a New Window or Demonize the process with Ctrl+c:

    mysql -uroot mysql
  6. Setting New Pass

    UPDATE mysql.user SET authentication_string=PASSWORD('YOUR-NEW-PASS'), plugin='mysql_native_password' WHERE User='root' AND Host='localhost';

    Change “YOUR-NEW-PASS” in the Above…
    And then “Ctrl+c” to Quit MySQL.

  7. Kill mysqld Process

    sudo pkill mysqld
    But you may need to find out the mysqld process with:
    ps ax | grep mysqld
    And then use the process ID to kill it as Eg.:
    sudo kill -9 166394
  8. Restart MySQL/MariaDB Server

    sudo service mysql start
    sudo service mariadb start

And with this your Issue of Resetting MySQL 5.7 Pass on Kali Linux 2020 should be Successfully Solved! ;)

Tags: , , ,

QuickChic Theme • Powered by WordPress