Fri. Dec 6th, 2019

Host your Website

Read and learn

FatCow Web Hosting $1.00/mo* Trust your web hosting to the #1 web host provider, GoDaddy!

How to Reset Admin (root) Password on MySQL

2 min read



Author: Jeremy Druin
Twitter: @webpwnized
Thank you for watching. Please help! Up vote, subscribe or even support this channel at https://www.youtube.com/user/webpwnized (Click Support).

With access to the MySQL server, the MySQL root (administrator) password can be reset. The MySQL administrative user (aka root) stores its password hash in the mysql.user table (as does all MySQL users). By starting the MySQL server with skip grants option and using SQL queries to overwrite the MySQL root/admin password hash, the MySQL root/admin/administrator password can be changed to any value.

The MySQL instance demoed in the video is installed on Ubuntu Linux but the technique works on any Linux or Windows system because the technique interacts with the MySQL server itself. The Windows or Linux operating system is not important.

MySQL Server does not store passwords, but instead stores password hashes. When the user enters a password, the system hashes the password then compares the calculated password hash against the password hash on file in the MySQL user table. If the two password hashes match, the system authenticates the user. The root/admin user has more privileges than other users

The webpwnized YouTube channel is dedicated to information security, security testing and ethical hacking. There is an emphasis on web application security but many other topics are covers. Some of these include forensics, network security, security testing tools and security testing processes. The channel provides videos to encourage software developers and system administrators to perform security testing. Also, the channel educates the next generation of security testers and bug bounty hunters who want to respectfully, legally and ethically help system owners that allow security testing.

25 thoughts on “How to Reset Admin (root) Password on MySQL

  1. it works but inlast there is a spelling mistake->update user set plugin = "mysql_native_passwor" where user='root';
    which results the error in loging in please help me out and the error is ERROR 1524 (HY000): Plugin 'mysql_native_passwor' is not loaded

  2. after tapping mysqld_safe –skip-grant-tables & here it what it say
    2018-10-11T22:48:22.022986Z mysqld_safe Logging to '/var/log/mysql/error.log'.
    2018-10-11T22:48:22.035620Z mysqld_safe Directory '/var/run/mysqld' for UNIX socket file don't exists.
    can u help my with that

  3. When I type:: # mysqld_safe –skip-grant-tables &
    the terminal hangs, it never returns back to the prompt after printing: mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
    I'm on SalixOS latest.

    If I ctrl+c to return the prompt i get: [1] Done
    but whether I do that or not, this happens:
    $sudo mysql -u root
    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (2 "No such file or directory")

    and that is after trying the fix linked below, like so:
    mkdir -p /var/run/mysqld
    chown mysql:mysql /var/run/mysqld

  4. Thanks a lot, but don't working((( ubuntu server 4.4.0 & mysql 5.7.2.2

    this methods (dpkg-reconfigure mysql-server) & (mysqld_safe –skip-grant-tables &) not approach. Help!

  5. hey dude, i have this Error, can u helpme please???
    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

Comments are closed.

Copyright © All rights reserved. | Newsphere by AF themes.