Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-26107

Cannot set character_set variables in my.ini

Details

    • Task
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • N/A
    • Variables
    • None

    Description

      According to the documentation, trying to set the variable character_set_results should done by something like:

      [mysqld]
      datadir=C:/Program Files/MariaDB 10.5/data
      port=3306
      default-storage-engine=MyISAM
      skip-innodb
      #innodb_buffer_pool_size=1010M
      character-set-results=utf8mb4
      [client]
      port=3306
      plugin-dir=C:/Program Files/MariaDB 10.5/lib/plugin
      

      But trying to start the server fails:

      C:\Program Files\MariaDB 10.5\bin>mariadbd --console
      2021-07-07 17:24:40 0 [Note] mariadbd (mysqld 10.5.9-MariaDB) starting as process 1664 ...
      2021-07-07 17:24:40 0 [Note] Plugin 'InnoDB' is disabled.
      2021-07-07 17:24:40 0 [Note] Plugin 'FEEDBACK' is disabled.
      2021-07-07 17:24:40 0 [Note] CONNECT: Version 1.07.0002 Feb 19 2021 10:36:16
      2021-07-07 17:24:40 0 [ERROR] mariadbd: unknown variable 'character-set-results=utf8mb4'
      2021-07-07 17:24:40 0 [ERROR] Aborting
      

      This happens with all character set variables. Other variables can be set without problems.

      Attachments

        Issue Links

          Activity

            alice Alice Sherepa added a comment -

            This is because character-set-results does not exist as a command-line or a config-file option, it is only a global/session variable. In the documentation, the absence of a command-line/config-file capability can be recognized by not having a line "Commandline" in the description, e.g. here ( https://mariadb.com/kb/en/server-system-variables/#character_set_results ), while the next one - character_set_server - has "Commandline: --character-set-server"

            alice Alice Sherepa added a comment - This is because character-set-results does not exist as a command-line or a config-file option, it is only a global/session variable. In the documentation, the absence of a command-line/config-file capability can be recognized by not having a line "Commandline" in the description, e.g. here ( https://mariadb.com/kb/en/server-system-variables/#character_set_results ), while the next one - character_set_server - has "Commandline: --character-set-server"

            Well, I understand. However, it is needed for C# client applications (see MDEV-26105) so the fix is to make it a command-line or config-file option.

            bertrandop Olivier Bertrand added a comment - Well, I understand. However, it is needed for C# client applications (see MDEV-26105 ) so the fix is to make it a command-line or config-file option.

            for mysql command line client it's the option --default-character=set that sets character_set_result.

            For mysql-conector-net supposedly one can specify charset as a connection option, like "server=127.0.0.1;uid=root;pwd=12345;charset=utf8mb4".

            serg Sergei Golubchik added a comment - for mysql command line client it's the option --default-character=set that sets character_set_result . For mysql-conector-net supposedly one can specify charset as a connection option, like "server=127.0.0.1;uid=root;pwd=12345;charset=utf8mb4" .

            Of course it is a client option. Trying to set --default-character-set when starting the server fails.

            Specifying character set
            Use this one to specify which character set to use to encode queries sent to the server.

            Server=myServerAddress;Database=myDB;Uid=myUsername;Pwd=myPwd;CharSet=utf8;
            

            Note that resultsets still are returned in the character set of the data returned.

            bertrandop Olivier Bertrand added a comment - Of course it is a client option. Trying to set --default-character-set when starting the server fails. Specifying character set Use this one to specify which character set to use to encode queries sent to the server. Server=myServerAddress;Database=myDB;Uid=myUsername;Pwd=myPwd;CharSet=utf8; Note that resultsets still are returned in the character set of the data returned.

            People

              serg Sergei Golubchik
              bertrandop Olivier Bertrand
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.