Parametry bazy MySQL

Konfiguracja bazy MySQL jest zapisana w kilkunastu plikach konfiguracyjnych odpowiedzialnych za różne zakresy działania bazy. Aby wyświetlić główne parametry bazy (Server System Variables) należy wykonać polecenie

MariaDB [(none)]> SHOW VARIABLES;

Polecenie zwróci kilkaset parametrów. Pełną listę wraz z wyjaśnieniem ich znaczenia znajdziemy na stronie:
https://mariadb.com/kb/en/mariadb/server-system-variables/#general_log

Aby wyświetli konkretny parametr musimy użyć opcji WHERE 🙂
Czyli np
MariaDB [(none)]> SHOW variables where Variable_name like 'VERSION';

+---------------+-----------------+
| Variable_name | Value           |
+---------------+-----------------+
| version       | 10.1.22-MariaDB |
+---------------+-----------------+
1 row in set (0.00 sec)

MariaDB [(none)]> SHOW variables where Variable_name like 'version%';

+-------------------------+---------------------------------+
| Variable_name           | Value                           |
+-------------------------+---------------------------------+
| version                 | 10.1.22-MariaDB                 |
| version_comment         | MariaDB Server                  |
| version_compile_machine | x86_64                          |
| version_compile_os      | Linux                           |
| version_malloc_library  | system jemalloc                 |
| version_ssl_library     | OpenSSL 1.0.1e-fips 11 Feb 2013 |
+-------------------------+---------------------------------+
6 rows in set (0.00 sec)

MariaDB [(none)]> SHOW variables where Variable_name like 'license%';

+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| license       | GPL   |
+---------------+-------+
1 row in set (0.00 sec)

MariaDB [(none)]> SHOW variables where Variable_name like 'character%' or variable_name like 'collation%';

+--------------------------+----------------------------+
| Variable_name            | Value                      |
+--------------------------+----------------------------+
| character_set_client     | utf8                       |
| character_set_connection | utf8                       |
| character_set_database   | latin1                     |
| character_set_filesystem | binary                     |
| character_set_results    | utf8                       |
| character_set_server     | latin1                     |
| character_set_system     | utf8                       |
| character_sets_dir       | /usr/share/mysql/charsets/ |
| collation_connection     | utf8_general_ci            |
| collation_database       | latin1_swedish_ci          |
| collation_server         | latin1_swedish_ci          |
+--------------------------+----------------------------+
11 rows in set (0.00 sec)

MariaDB [(none)]> SHOW variables where Variable_name like 'log%';

+---------------------------------+--------------------------------------------------------------------------------------------------------------+
| Variable_name                   | Value                                                                                                        |
+---------------------------------+--------------------------------------------------------------------------------------------------------------+
| log_bin                         | OFF                                                                                                          |
| log_bin_basename                |                                                                                                              |
| log_bin_index                   |                                                                                                              |
| log_bin_trust_function_creators | OFF                                                                                                          |
| log_error                       |                                                                                                              |
| log_output                      | FILE                                                                                                         |
| log_queries_not_using_indexes   | OFF                                                                                                          |
| log_slave_updates               | OFF                                                                                                          |
| log_slow_admin_statements       | OFF                                                                                                          |
| log_slow_filter                 | admin,filesort,filesort_on_disk,full_join,full_scan,query_cache,query_cache_miss,tmp_table,tmp_table_on_disk |
| log_slow_rate_limit             | 1                                                                                                            |
| log_slow_slave_statements       | OFF                                                                                                          |
| log_slow_verbosity              |                                                                                                              |
| log_tc_size                     | 24576                                                                                                        |
| log_warnings                    | 1                                                                                                            |
+---------------------------------+--------------------------------------------------------------------------------------------------------------+
15 rows in set (0.00 sec)

MariaDB [(none)]> SHOW variables where Variable_name like 'max%';

+----------------------------+----------------------+
| Variable_name              | Value                |
+----------------------------+----------------------+
| max_allowed_packet         | 4194304              |
| max_binlog_cache_size      | 18446744073709547520 |
| max_binlog_size            | 1073741824           |
| max_binlog_stmt_cache_size | 18446744073709547520 |
| max_connect_errors         | 100                  |
| max_connections            | 151                  |
| max_delayed_threads        | 20                   |
| max_digest_length          | 1024                 |
| max_error_count            | 64                   |
| max_heap_table_size        | 16777216             |
| max_insert_delayed_threads | 20                   |
| max_join_size              | 18446744073709551615 |
| max_length_for_sort_data   | 1024                 |
| max_long_data_size         | 4194304              |
| max_prepared_stmt_count    | 16382                |
| max_relay_log_size         | 1073741824           |
| max_seeks_for_key          | 4294967295           |
| max_session_mem_used       | 9223372036854775807  |
| max_sort_length            | 1024                 |
| max_sp_recursion_depth     | 0                    |
| max_statement_time         | 0.000000             |
| max_tmp_tables             | 32                   |
| max_user_connections       | 0                    |
| max_write_lock_count       | 4294967295           |
+----------------------------+----------------------+
24 rows in set (0.00 sec)

Ten wpis został opublikowany w kategorii MySQL (MariaDB) i oznaczony tagami . Dodaj zakładkę do bezpośredniego odnośnika.

Dodaj komentarz