NOTE: This is an old article. Please go to the Meshlium development section in order to get the latest tutorials.

Change root password for mysql

Requeriments:

  • At least one Meshlium

Sometimes we forget passwords. Sky is blue, roses are red, and passwords are forgotten. This howto will show how to change the root password for mysql.

Access Meshlium as root and follow the steps bellow:



Stop mysql

	~$ /etc/initd./mysql stop
	


Start mysql_safe

	~$ mysql_safe --skip-grant-tables &
	


Access mysql as root

	~$ mysql --user=root
	


Now just set up a new password for root

	mysql> use mysql;
	mysql> update user set password=PASSWORD("NEW-ROOT-PASSWORD") where User='root';
	mysql> flush privileges;
	mysql> quit
	


Stop mysql

	~$ /etc/initd./mysql stop
	


Start mysql

	~$ /etc/initd./mysql start
	


Now you can access mysql as root with the new password.And keep this password beter than before :X


© Libelium Comunicaciones Distribuidas S.L.

| Terms of use