次の方法でmysqlを呼び出しています。
mysql -h localhost -u user -p db
これにより、ユーザーはパスワードの入力を求められます。
ただし、interactive_timeout を 60 秒に設定しました。
60 秒後、クライアントはタイムアウトしますが、再接続オプションが false に設定されていないため、再接続を試みます。再接続中、mysql クライアントはパスワードを要求しません。再接続中にパスワードを要求するようにしたい。誰でもこれについて私を助けることができますか?
これが出力例です
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
再接続時にパスワードを要求するようにしたい