MySQL接続時にWelcomeメッセージを表示しない方法 †mysqlコマンドを利用しMySQLサーバに接続したとき、Welcomeメッセージが表示されます。 Welcomeメッセージの抑止 †通常の接続の場合、Welcomeメッセージが表示されます。 # mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 6 Server version: 5.1.61 Source distribution Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> mysqlコマンドに-sオプションを追加することにより、Welcomeメッセージが表示されなくなり、mysqlプロンプトがすぐに表示されます。 $ mysql --help <snip> -s, --silent Be more silent. Print results with a tab as separator, each row on new line. <snip> 以下、-sオプションを追加した場合の実行結果です。 Welcomeメッセージが表示されず、mysqlプロンプトがすぐに表示されているのが確認できます。 # mysql -u root -p -s Enter password: mysql> 尚、-sオプションにより以下のようなメッセージも表示されなくなります。 Query OK, 0 rows affected (0.00 sec) |