next up previous contents
Next: 忘記 root 密碼 Up: 安裝與配置 Mariadb Previous: MariaDB 配置   Contents   DYWANG_HOME

查詢 MariaDB 參數

  1. 不改變 MariaDB 配置下,查詢 character 相關的變數如下:
    [root@kvm8 ~]# mysql -uroot -pqweqwe
    Welcome to the MariaDB monitor.  Commands end with ; or \g.
    Your MariaDB connection id is 9
    Server version: 10.3.11-MariaDB MariaDB Server
    
    Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
    
    Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
    
    MariaDB [(none)]> show variables like '%character%';
    +--------------------------+------------------------------+
    | 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/mariadb/charsets/ |
    +--------------------------+------------------------------+
    8 rows in set (0.003 sec)
    
  2. MariaDB 配置變更並重新啟動後,查詢 character 相關的變數,所有編碼都改成 utf8。
    MariaDB [(none)]> 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 (0.003 sec)
    
  3. 查詢 open_files_limit 變數,目前設定為 10000。
    mariadb root@localhost:(none)> show variables like "open_files_limit";          
    +------------------+-------+
    | Variable_name    | Value |
    +------------------+-------+
    | open_files_limit | 10000 |
    +------------------+-------+
    1 row in set
    Time: 0.021s
    



De-Yu Wang 2020-04-07