I wanted to reset the mysql root password of one of my temporary hosted mysql database server. Since it was not used for a long period of time, I couldn't remember the the root password correctly.
As the first step, I loged into the server as the root user. I was using a Ubuntu 12.04 server.
First log in to the system as a normal user and then 'sudo' to get root access.
As the second step it was need to stop the mysql daemon using the following command.
$/etc/init.d/mysql stop
$service mysql stop
Please note that any of the above command is working fine.
As the third step, I started up the mysql daemon and skipped the grant tables which store the passwords using the following command.
$mysqld_safe --skip-grant-tables
As the next step I connected to mysql without a password.
$mysql --user=root mysql
As the final step I entered the following command to set a password to the root user.
$UPDATE user SET Password=PASSWORD('new-password') WHERE user='root'; FLUSH PRIVILEGES;
The below listed format of the command also worked as expected
$UPDATE mysql.user SET Password=PASSWORD('new-password') WHERE User='root'; FLUSH PRIVILEGES;
Hope this will work fine to you also....:)
Reset mysql root Password
October 28, 2013 / by Kushan Sharma / with No comments /
Related Posts:
Firewalking with nmapFirewalking is a technique developed by Mike Schiffman and David Goldsmith that utilizes traceroute techniques and TTL values to analyze IP packet res… Read More
Configure Wireless Network: Edit /etc/network/interfeces of Ubuntu 14.04To discover the available wireless interfaces $sudo lspci |grep Wireless$sudo lspci |grep Network To discover the available wireless networks $sudo i… Read More
Install and Use Nmap/Zenmap 6 in Ubuntu 14.04For the installation, you follow the steps listed below. If you don't have the alien command, install it with a command such as $sudo apt-get install… Read More
Blocking intrusion attempts using authentication module pam_tally2It is possible to block these intrusions using the authentication module called "pam_tally2". This module maintains a count of attempted accesses, can… Read More
Forcing Password Complexity in Red Hat LinuxMy requirement was to enforce the password complexity for all the users of my RHEL 5 server (This will works for RHEL 4/5 also). This would be helpful… Read More
0 comments:
Post a Comment