mariadb root@localhost:dyw> select version(); +-----------------+ | version() | +-----------------+ | 10.3.11-MariaDB | +-----------------+ 1 row in set Time: 0.048s
mariadb root@localhost:dyw> select database(); +------------+ | database() | +------------+ | dyw | +------------+ 1 row in set Time: 0.020s
mariadb root@localhost:dyw> select user(); +----------------+ | user() | +----------------+ | root@localhost | +----------------+ 1 row in set Time: 0.042s
show status
查看狀態,但資料很多,一般都會配合 like
查詢,以下是只查有 table
字串的訊息。
mariadb root@localhost:dyw> show status like "%table%"; +-----------------------------------------+-------+ | Variable_name | Value | +-----------------------------------------+-------+ | Acl_table_grants | 0 | | Com_alter_table | 0 | | Com_alter_tablespace | 0 | | Com_create_table | 3 | | Com_create_temporary_table | 0 | | Com_drop_table | 0 | | Com_drop_temporary_table | 0 | | Com_lock_tables | 0 | | Com_rename_table | 0 | | Com_show_create_table | 3 | | Com_show_open_tables | 0 | | Com_show_table_status | 0 | | Com_show_tables | 0 | | Com_unlock_tables | 0 | | Created_tmp_disk_tables | 0 | | Created_tmp_tables | 0 | | Open_table_definitions | 10 | | Open_tables | 6 | | Opened_table_definitions | 2 | | Opened_tables | 3 | | Performance_schema_table_handles_lost | 0 | | Performance_schema_table_instances_lost | 0 | | Slave_open_temp_tables | 0 | | Table_locks_immediate | 237 | | Table_locks_waited | 0 | | Table_open_cache_active_instances | 1 | | Table_open_cache_hits | 16 | | Table_open_cache_misses | 3 | | Table_open_cache_overflows | 0 | +-----------------------------------------+-------+
show variables
查看變數,但變數很多,一般都會配合 like
查詢,以下是只查包含 character
字串的變數。
mariadb root@localhost:dyw> show variables like "%character%"; +--------------------------+------------------------------+ | Variable_name | Value | +--------------------------+------------------------------+ | character_set_client | utf8 | | character_set_connection | utf8 | | character_set_database | utf8 | | character_set_filesystem | binary | | character_set_results | utf8 | | character_set_server | utf8 | | character_set_system | utf8 | | character_sets_dir | /usr/share/mariadb/charsets/ | +--------------------------+------------------------------+ 8 rows in set Time: 0.022s