MySQLコンソールではなく、OS上のMySQLコマンドを用いて、MySQLの情報を確認する方法を記録しておきます。
バージョン確認
mysqladmin コマンドでバージョン確認する。
# mysqladmin version -u root -p Enter password: mysqladmin Ver 8.42 Distrib 5.5.23, for Linux on x86_64 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. Server version 5.5.23-log Protocol version 10 Connection Localhost via UNIX socket UNIX socket /var/lib/mysql/mysql.sock Uptime: 153 days 20 hours 52 sec Threads: 1 Questions: 59305791 Slow queries: 0 Opens: 164690 Flush tables: 1 Open tables: 62 Queries per second avg: 4.462 #
設定値確認
mysqladmin コマンドで、MySQLサーバの設定値を確認できる。
# mysqladmin variables -u root -p Enter password: -------------------------------------------------------+ | Variable_name | Value -------------------------------------------------------+ | auto_increment_increment | 1 | auto_increment_offset | 1 | autocommit | ON ・・・(以下省略)・・・ #
このコマンドで、大体の設定値が取れそう。
データベース一覧の確認
mysqlshow コマンドで、データベースの一覧を表示する。
# mysqlshow -u root -p Enter password: +--------------------+ | Databases | +--------------------+ | information_schema | | mysql | ・・・(省略)・・・ | performance_schema | +--------------------+ #
指定データベース内のテーブル一覧
データベースを指定し、そのデータベース内にあるテーブルの一覧を表示する。
# mysqlshow mysql -u root -p Enter password: Database: mysql +---------------------------+ | Tables | +---------------------------+ | columns_priv | | db | | event | | func | | general_log | | help_category | | help_keyword | | help_relation | | help_topic | | host | | ndb_binlog_index | | plugin | | proc | | procs_priv | | proxies_priv | | servers | | slow_log | | tables_priv | | time_zone | | time_zone_leap_second | | time_zone_name | | time_zone_transition | | time_zone_transition_type | | user | +---------------------------+ #
まだまだ色々あると思います。
オプションに、「-u アカウント -p パスワード」を付けるのがポイントです。