免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 11688 | 回复: 7
打印 上一主题 下一主题

mysql的历史命令 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-09-11 16:37 |只看该作者 |倒序浏览
在mysql中,可以按向上方向键来调出以前的命令,如何取消该功能?mysql是不是有一个类似操作系统的
.bash_history文件来记录历史命令?如果有,该文件的位置是?谢谢了!

论坛徽章:
0
2 [报告]
发表于 2006-09-11 17:43 |只看该作者

回复 1楼 lifeistrue 的帖子

在你所使用的用户的用户目录下
.mysql_history

论坛徽章:
0
3 [报告]
发表于 2006-09-11 17:48 |只看该作者
OK,谢谢楼上的!

论坛徽章:
0
4 [报告]
发表于 2006-09-11 17:50 |只看该作者
呵呵,一个新的问题,mysql有命令清空历史命令吗?在不手工编辑.mysql_history的情况下

论坛徽章:
0
5 [报告]
发表于 2006-09-11 17:55 |只看该作者

回复 4楼 lifeistrue 的帖子

On Unix, the mysql client writes a record of executed statements to a history file. By default, the history file is named .mysql_history and is created in your home directory. To specify a different file, set the value of the MYSQL_HISTFILE environment variable.

If you do not want to maintain a history file, first remove .mysql_history if it exists, and then use either of the following techniques:

Set the MYSQL_HISTFILE variable to /dev/null. To cause this setting to take effect each time you log in, put the setting in one of your shell's startup files.

Create .mysql_history as a symbolic link to /dev/null:

shell> ln -s /dev/null $HOME/.mysql_history

You need do this only once.

论坛徽章:
0
6 [报告]
发表于 2006-09-11 19:49 |只看该作者

回复 5楼 dangk 的帖子

非常详细的说明!谢谢!

论坛徽章:
0
7 [报告]
发表于 2006-09-12 17:30 |只看该作者

回复 6楼 lifeistrue 的帖子

是抄手册的,赫赫

论坛徽章:
5
IT运维版块每日发帖之星
日期:2015-11-10 06:20:00IT运维版块每日发帖之星
日期:2016-07-19 06:20:00JAVA
日期:2016-10-25 16:03:37PHP
日期:2016-10-25 16:03:37Python
日期:2016-10-25 16:03:37
8 [报告]
发表于 2015-11-04 11:07 |只看该作者
cat  ~/.mysql_history
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP