reset XAMPP MySQL root password via PHPMYADMIN

Thursday, 8. November 2012

A little snippet for resetting a mysql root password via phpmyadmin

UPDATE mysql.USER SET Password=PASSWORD('password') WHERE USER='root';

RESET Mysql Root Password In LAMPP or XAMPP

Sunday, 30. September 2012

If you are reading this, chances are you have either lost or forgotten your mysql root password and definitely in need of help!

OK – this solution assumes you have access to your Lampp installation files.

- Go to your config file: lampp/etc/my.cnf 
- Open the file and look for text: [mysqld]
- Under it, insert text: skip-grant-tables
- Restart MySQL

Now access your phpmyadmin: localhost/phpmyadmin. You should be able to log in without the need of password

You can now change/reset the root password to something else:

UPDATE mysql.USER SET Password='new_password' WHERE USER='root'


Add Non Sudoer Account to the Sudoer User Group

Sunday, 29. July 2012

If you ever wanted to add a new non-sudoer account to sudoer group, here is the simple steps to help you achieve just that.

Log in to your server/machine as root.

Navigate and open the sudoers file

nano /etc/sudoers #Use your preferred editor
sudo visudo #Better as it checks for syntax errors.

Once the file is opened, navigate to the bottom of the file until you find the line like this below..

## Allow root to run any commands anywhere
root    ALL=(ALL)	ALL

Underneath this last line, add the account details you want make sudoer

useraccount ALL=(ALL)	NOPASSWD:ALL

This simply allows the new account to use/call the sudo commands without having to type the password.

Save the file, and restart your terminal session again.

Some time you may have to delete the following entry in order to make things working.. do this if the first steps still gives you the same error.

Scroll right at the bottom and look for this line:

#includedir /etc/sudoers.d

Remove it! Restart session and you should be OK!