Heim  >  Artikel  >  Datenbank  >  linux mysql 破解root 密码

linux mysql 破解root 密码

WBOY
WBOYOriginal
2016-06-07 15:33:311172Durchsuche

Unix linux 第一:首先要把mysqld停止,最好都kill掉 killall mysqld 第二:启动mysql,但是要跳过权限表 /usr/local/mysql/bin/mysqld_safe --skip-grant-tables 第三:进去mysql,并修改密码 /usr/local/mysql/bin/mysql -u root mysqluse mysql; mysqlupd

Unix && linux
第一:首先要把mysqld停止,最好都kill掉
killall mysqld
第二:启动mysql,但是要跳过权限表
/usr/local/mysql/bin/mysqld_safe --skip-grant-tables &
第三:进去mysql,并修改密码
/usr/local/mysql/bin/mysql -u root
mysql>use mysql;
mysql>update user set password=password("new_pass") where user="root";
mysql>flush privileges;
mysql>\q
第四:重新启动mysql,正常进入。

Windows
第一:进入Windows窗口命令行下,停止mysql服务: net stop mysql
第二:进入mysql的安装目录下,进去bin目录
mysqld-nt.exe --skip-grant-tables
第三:再另一个窗口下,进去mysql的安装目录,并修改密码:
执行mysql.exe
>use mysql;
>update set user password=password("new_pass") where user="root";
>flush privileges;
>\q
第四:结束mysqld-nt进程,重新启动mysql


在windows中,如果上面的方法无法解决,可以在my.ini中的[MySQLd]配置段添加如下一行:
skip-grant-tables

然后保存,再重启mysql,最后使用mysql -uroot 即可使用root用户进入。

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn