HOWTO Reconver admin's password for MYSQL Server - Ubuntu 8.04
1.- Admin's password is lost
2.- Stop Mysql Service
INPUT:
INPUT:
INPUT:
INPUT:
1.- Admin's password is lost
wmunguiam@server:/var/www$ mysqlshow -uroot -p
Enter password:
mysqlshow: Access denied for user 'root'@'localhost' (using password: YES)
2.- Stop Mysql Service
wmunguiam@server:/var/www$ su3.- Start Mysql server but without reading Grant Tables
Contraseña:
root@server:/var/www# /etc/init.d/mysql stop
* Stopping MySQL database server mysqld [ OK ]
root@server:/var/www#
INPUT:
root@server:/var/www# /usr/bin/mysqld_safe --skip-grant-tables &OUTPUT:
[1] 77644.- Login to Myqsl console
root@server:/var/www# nohup: se ignora la entrada y se redirige stderr hacia stdout
Starting mysqld daemon with databases from /var/lib/mysql
mysqld_safe[7803]: started
INPUT:
root@server:/var/www# mysql -u rootOUTPUT:
Welcome to the MySQL monitor. Commands end with ; or \g.5.- Use DB Mysql
Your MySQL connection id is 1
Server version: 5.0.51a-3ubuntu5.4 (Ubuntu)
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>
INPUT:
mysql> use mysqlOUTPUT:
Reading table information for completion of table and column names6.- Change Password
You can turn off this feature to get a quicker startup with -A
Database changed
INPUT:
mysql> UPDATE mysql.user SET Password=PASSWORD('NewPassHere') WHERE User='root';OUTPUT:
Query OK, 1 row affected (0.00 sec)7.- Quit Mysql console & Restart Mysql service
Rows matched: 1 Changed: 1 Warnings: 0
mysql> quit8.- Test updated Admin's password
Bye
root@server:/var/www# /etc/init.d/mysql restart
* Stopping MySQL database server mysqld STOPPING server from pid file /var/run/mysqld/mysqld.pid
mysqld_safe[9089]: ended
[ OK ]
* Starting MySQL database server mysqld [ OK ]
* Checking for corrupt, not cleanly closed and upgrade needing tables.
[1]+ Done /usr/bin/mysqld_safe --skip-grant-tables
root@server:/var/www#
wmunguiam@server:/var/www$ mysqlshow -uroot -pNewPassHere
root@server:/home/wmunguiam# mysqlshow -uroot -pNewPassHere
+-------------------------+
| Databases |
+-------------------------+
| information_schema |
| gts |
| mysql |
+-------------------------+
Comments
Post a Comment