fedora mysql root Password Reset

1.Stop mysql service

[root@localhost han]#/etc/init.d/mysqld stop
Stop MySQL: [OK]

2.Start mysql service with the following command

[root@localhost han]#mysqld_safe --user=mysql --skip-grant-tables --skip-networking &

(Prompt message: [root@localhost han]# nohup: ignoring input and redirecting stderr to stdout Starting mysqld daemon with databases from /var/lib/mysql)

3.After a successful start, enter the following

mysql -u root mysql

4.Successful entry, change passwords

mysql> use mysql
Database changed
mysql> show tables;
+---------------------------+
| Tables_in_mysql |
+---------------------------+
| columns_priv |
| db |
| func |
| help_category |
| help_keyword |
| help_relation |
| help_topic |
| host |
| proc |
| procs_priv |
| tables_priv |
| time_zone |
| time_zone_leap_second |
| time_zone_name |
| time_zone_transition |
| time_zone_transition_type |
| user |
+---------------------------+
17 rows in set (0.00 sec)

mysql> UPDATE user SET Password=PASSWORD('root') where USER='root';
Query OK, 0 rows affected (0.00 sec)
Rows matched: 0 Changed: 0 Warnings: 0

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)

mysql> quit
Bye
[root@localhost han]# killall -9 mysqld
/usr/bin/mysqld_safe: line 388: 4842 已杀死nohup /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysqld/mysqld.pid --skip-external-locking --socket=/var/lib/mysql/mysql.sock --skip-grant-tables --skip-networking >> /var/log/mysqld.log 2>&1
[root@localhost han]#
Number of processes running now: 0
081220 20:43:36mysqld restarted

5.Start mysql service

[root@localhost han]#/etc/init.d/mysqld start

Start MySQL: [OK]

6.Enter password changes after a successful landing

[root@localhost han]#mysql -u root -p

original text:http://www.thinksaas.cn/group/topic/256092/

Pingbacks are closed.

Trackbacks
Comments