—¡Aló, soporte técnico!
—¡$#%&%/$!...

—¡#%&#)*!...
—¡Listo! ya está arreglado, que tengas un buen día.

viernes, 12 de junio de 2015

Si olvidaste la contraseña de root@localhost de MySQL, aquí como resolverslo

Perdiste aquel papelito donde dejaste anotado la contraseña de root@localhost de tu servidor MySQL y te ecnuentras con:

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

Eso le pasa a muchos y para ello te recomiendo que uses KeePass2.

Te dejo unos sencillos pasos para reconfigurar MySQL y restablecer tu contrraseña:




$ apt-cache policy mysql-server
mysql-server:
  Installed: 5.5.43-0ubuntu0.12.04.1
  Candidate: 5.5.43-0ubuntu0.12.04.1
  Version table:
 *** 5.5.43-0ubuntu0.12.04.1 0
        500 http://us.archive.ubuntu.com/ubuntu/ precise-updates/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu/ precise-security/main amd64 Packages
        100 /var/lib/dpkg/status
     5.5.22-0ubuntu1 0
        500 http://us.archive.ubuntu.com/ubuntu/ precise/main amd64 Packages
[1]   Exit 1                  sudo /usr/sbin/mysqld --skip-grant-tables --skip-networking
[2]-  Exit 1                  sudo /usr/sbin/mysqld --skip-grant-tables --skip-networking
$ sudo dpkg-reconfigure mysql-server-5.5
En este comando debes colocar la misma versión de MySQL que te arrojó el comando anterior, en este ejemplo 5.5
Listo, te pedirá que ingreses una nueva contraseña de root.

$ mysql -u root -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 36
Server version: 5.5.38-0ubuntu0.12.04.1 (Ubuntu)

Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> CREATE database mesdelpadre;

Disfruten.




No hay comentarios: