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
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
Configure wvdial.conf in Ubuntu 14.04I wanted to configure my Etisalat broadband connection with Ubuntu 14.04. Network Manager has already been uninstalled. In order to connect to the br… Read More
Whether to enable "System Cryptography: Use FIPS compliant algorithms for encryption, hashing, and signing"Use of "System Cryptography: Use FIPS compliant algorithms for encryption, hashing, and signing"is the standard recommendation in order to align with … 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
0 comments:
Post a Comment