Home  >  Article  >  Database  >  尚客:MYSQL安全之删除历史操作文件_MySQL

尚客:MYSQL安全之删除历史操作文件_MySQL

WBOY
WBOYOriginal
2016-06-01 13:12:291133browse

查找 mysql的data文件安装在哪里:

进入 mysql 然后模糊搜索:

mysql> show variables like '%data%';  // 模糊搜索

mysql> show variables like 'datadir';  // 精确查找


.bash_history .mysql_history  一般是在 home 目录下的。

$HOME意思home目录般/home/xxx/xxx登陆用户名。

而如果你是root 用户登录的话,就直接在 /root 目录里面,因为root 的home 就是 root

 

 

删除文件,同时在进行登陆或备份数据库等与密码相关操作时,应该使用-p参数加入提示输入密码后,隐式输入密码。

 

# rm .bash_history .mysql_history //删除历史记录

 

# ln -s /dev/null .bash_history //将shell记录文件置空

 

# ln -s /dev/null .mysql_history //将mysql记录文件置空

 

 

找到mysql 的历史记录文件 例如 .mysql_history 这个文件

可以直接 rm .mysql_history  删除mysql 的历史记录


Statement:
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