首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >mysql客户端重新连接时提示输入密码

问mysql客户端重新连接时提示输入密码
EN

Stack Overflow用户
提问于 2012-10-20 08:54:18
回答 1查看 72关注 0票数 3

我通过以下方式调用mysql:

代码语言:javascript
复制
mysql -h localhost -u user -p db 

这将提示用户输入密码。

但是,我已经将interactive_timeout设置为60秒。

60秒后,客户端将超时,但由于重新连接选项未设置为false,因此它将尝试重新连接。重新连接时,mysql客户端不提示输入密码。我想让它在重新连接时提示输入密码。有人能帮我这个忙吗。

以下是示例输出

代码语言:javascript
复制
mysql -h localhost -u user -p db 
Enter password: 
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 26
Server version: 5.1.58 MySQL Community Server (GPL)

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> show variables;
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id:    30
Current database: db

我想让它在重新连接时提示输入密码

EN

回答 1

Stack Overflow用户

发布于 2012-10-20 09:13:58

您可以尝试查看aliasing mysql以指定--skip-reconnect (与interactive_timeout结合使用)是否可以工作

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/12984304

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档