[TRADUCIR] Resetear la password de root de MySQL

Hello, did you lost, forgot or somebody changed your MySQL password? Well, don’t be worried, before reinstall the entire MySQL from your Ubuntu, try with the codes below, maybe you can save a lot of headache.

Lets begin to restore the root’s password:

1. The first step is to open a Terminal.

2. You will need to stop the MySQL demon typing:
sudo /etc/init.d/mysql stop

3. Start the demon typing: (do not forget the & at the end)
sudo /usr/sbin/mysqld –skip-grant-tables –skip-networking &

4. Start MySQL client process as root:
mysql -u root
You will get the MySQL prompt: mysql>

5. Execute this command to be able to change any password. Do not forget to type the ; at the end, remember now you are in the MySQL client:

6. Then reset/update your password:
SET PASSWORD FOR root@’localhost’ = PASSWORD(‘yournewpassword’);

7. If your root accout connects from everywhere, execute this too:
UPDATE mysql.user SET Password=PASSWORD(‘yournewpassword’) WHERE User=’root’;

8. If your root account that can access from everywhere, execute:
USE mysql
UPDATE user SET Password = PASSWORD(‘newpwd’)
WHERE Host = ‘%’ AND User = ‘root’;

9. Again, execute the code below:

10. After all the steps above, get out of the MySQL client typing:

11. Finally, stop and start the service in the normal way:
sudo /etc/init.d/mysql stop
sudo /etc/init.d/mysql start

Now your root password is changed and you saved a lot of time.



Introduce tus datos o haz clic en un icono para iniciar sesión:

Logo de WordPress.com

Estás comentando usando tu cuenta de WordPress.com. Cerrar sesión /  Cambiar )

Google+ photo

Estás comentando usando tu cuenta de Google+. Cerrar sesión /  Cambiar )

Imagen de Twitter

Estás comentando usando tu cuenta de Twitter. Cerrar sesión /  Cambiar )

Foto de Facebook

Estás comentando usando tu cuenta de Facebook. Cerrar sesión /  Cambiar )


Conectando a %s