When you're lost in the password as MySQL superuser root in this exercise will get you out of trouble.
-server root @ ubuntu: ~ # / etc / init.d / mysql stop * Stopping MySQL database
server mysqld [OK] root @ server -ubuntu: ~ #
# 2: Start Service / MySQL daemon (mysqld) with the-skip-grant-tables so will not ask for password.
-server root @ ubuntu: ~ # mysqld_safe - skip-grant-tables &
[1] 10702 root @ servermysqld_safe [10741]: started
-ubuntu: ~ # nohup: redirecting stderr Ignoring input and stdout to
Starting mysqld daemon with databases from / var / lib / mysql
# 3: Connect to the MySQL server as root.
Type 'help,' or 'h' for help. Type 'c' to clear the buffer. mysql>
-server root @ ubuntu: ~ # mysql-u root
Welcome to the MySQL monitor. Commands end with; or g.
Your MySQL connection id is 1
Server version: 5.0.51a-3ubuntu5.4 (Ubuntu)
mysql> use mysql; Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A
Step 4: Configure
the new root password
.
in this case ("321") is the password that we are dando.
Database changed
mysql> update user set password=PASSWORD("321") where User='root'; Query OK, 3 rows affected (0.03 sec) Rows matched: 3 Changed: 3 Warnings: 0
mysql> flush privileges;Query OK, 0 rows affected (0.01 sec)
file / var / run / mysqld / mysqld.pid mysqld_safe [11414]: ended [OK] [1] + Done mysqld_safe - skip-grant-tables
Paso # 5: Salir y reiniciar el servidor MySQL
mysql> quit
Bye
root@servidor-ubuntu:~# /etc/init.d/mysql stop
* Stopping MySQL database server mysqld STOPPING server from pid
-server root @ ubuntu: ~ # mysql-u root-p
Step 6: Reset MySQL root @ server
-ubuntu: ~ # / etc / init.d / mysql start * Starting MySQL database
server mysqld [OK] * Checking for corrupt
, Not cleanly closed and Needing upgrade tables.
See more at the following site.
http://www.guatewireless.org/os/linux/mysql-recuperar-la-contrasena-de-root-en-5-pasos/* _ *)
0 comments:
Post a Comment