当前位置: 技术问答>linux和unix
SUSE11.4 找回 mysql root 密码?网上能找到的所有方法都试过了,不行...
来源: 互联网 发布时间:2016-12-30
本文导语: 系统默认的mysql,好像改过密码,然后,忘了...找回... # /etc/init.d/mysql stop Shutting down service MySQL ...
系统默认的mysql,好像改过密码,然后,忘了...找回...
# /etc/init.d/mysql stop
Shutting down service MySQL done
# mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
[1] 8123
linux-qnfx:/home/liushang # 110911 04:29:42 mysqld_safe Logging to '/var/log/mysql/mysqld.log'.
110911 04:29:42 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
按上面这种方法mysqld_safe这个进程直接就死这了,怎么等都没反应。
然后
# /etc/init.d/mysql start
Starting service MySQL done
# mysql -umysql
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 1
Server version: 5.1.53-log SUSE MySQL RPM
Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license
Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.
mysql>
再看看下边:
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| test |
+--------------------+
2 rows in set (0.00 sec)
mysql> use mysql;
ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'mysql'
mysql>
居然没有mysql数据库?那怎么update user表呢?
惆怅了...
# /etc/init.d/mysql stop
Shutting down service MySQL done
# mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
[1] 8123
linux-qnfx:/home/liushang # 110911 04:29:42 mysqld_safe Logging to '/var/log/mysql/mysqld.log'.
110911 04:29:42 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
按上面这种方法mysqld_safe这个进程直接就死这了,怎么等都没反应。
然后
# /etc/init.d/mysql start
Starting service MySQL done
# mysql -umysql
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 1
Server version: 5.1.53-log SUSE MySQL RPM
Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license
Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.
mysql>
再看看下边:
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| test |
+--------------------+
2 rows in set (0.00 sec)
mysql> use mysql;
ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'mysql'
mysql>
居然没有mysql数据库?那怎么update user表呢?
惆怅了...
|
直接重装就没事了,毕竟你没有多少数据库
|
root忘了,学习下怎么找回
|
如果给你找回了,mysql也没人敢用了