Ubuntu change mysql root password => http://ussirory.nnmcloud.ru/d?s=YToyOntzOjc6InJlZmVyZXIiO3M6MjE6Imh0dHA6Ly9iaXRiaW4uaXQyX2RsLyI7czozOiJrZXkiO3M6MzM6IlVidW50dSBjaGFuZ2UgbXlzcWwgcm9vdCBwYXNzd29yZCI7fQ== To set up a root password for the first time, use the mysqladmin command at the shell prompt as follows: mysqladmin -u root password newpass If you want to change or update a root password to the new password ' newpass', then you need to use the following command: mysqladmin -u root -p password newpass Enter password: If you get. Step 7: Please execute this command. In order to try out the recovery methods in this tutorial without affecting your production server, use the to create a test server with a regular, non-root user with sudo privileges. In the next tutorial we are going to learn. The word ' password' in the above example is part of the command, do not replace that with your password. This will stop the database daemon. It is a good thing to unplug your server from the network or at least disable remote access. This removes every file related to mysql. This article was co-authored by our trained team of editors and researchers who validated it for accuracy and comprehensiveness. Not only will this command set the root user password, but it will allow you to remove anonymous users, disallow remote root login, and remove the test database. With that said, let's get to work. Normally, root should only be allowed to connect from 'localhost'. Setting, Changing And Resetting MySQL Root Passwords - If you are on 16. Neither this solution nor other solutions from various blogs solved the same issue with my machine. Content Cleanup Required This article should be cleaned-up to follow the content standards in the Wiki Guide. Please do not make any edits to this article. Its contents are currently under review and being merged with the Ubuntu Server Guide. Or do you receive error messages like the following. All connexions will have a root access. It is a good thing to unplug your server from the network or at least disable remote access. An easy way to have a full control of your mysql server is phpmyadmin www. Another way, purge I also had some problems with mysql just not accepting my password. I tried the other way as well and it just ended up being difficult. I had not been able to use mysql so it was empty anyway. This removes every file related to mysql. Depending on your installation the packages might be diffrent, mysql-server in 6. Make sure to notedown your password. Thanks to Illuvator for posting this method in the ubuntu forum. The Easiest Method sudo dpkg-reconfigure mysql-server-N. N is the Server version.