Home > Database > Mysql Tutorial > 谁干的mysql无密码登录?_MySQL

谁干的mysql无密码登录?_MySQL

WBOY
Release: 2016-06-01 13:07:27
Original
1029 people have browsed it

某个mysql数据库服务器,运行了很久一直都很正常。因为从数据库服务器硬件损坏,需要重新导入数据库进行同步。再执行操作时,忘记输入选项-p(mysql -u root ),居然直接进去了。吓得不轻啊。

赶紧登录进去,看是否存在密码为空的帐号,没查到啊?强制更改root密码,然后flush privilges。再试,还是可以不用密码登录。

查一下选项文件/etc/my.cnf,看是否有密码被直接写到文件里,还是没有。再拿find搜一把,发现目录/root里有文件 .my.cnf,打开看一下,其内容为:

[client]

user=root

password=i%^KgG76

删掉这个文件,再执行mysql,嘿嘿,进不去了吧!

这可能是某人为了方便调试数据库,隐藏了一个文件在这里。

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template