Search code examples
mysqldatabasesystem-variable

How to change read-only permission to set new value of MySQL server system variable


I am new to MySQL; recently I faced this problem while setting a new value for a system variable.

I tried:

mysql> set global innodb_ft_min_token_size = 6;

but I am getting this error:

ERROR 1238 (HY000): Variable 'innodb_ft_min_token_size' is a read only variable

Is there any way to change the read only permission? I read about InnoDB parameters but could not resolve the problem.


Solution

  • The site you linked contains all information needed:

    System variables that are true or false can be enabled at server startup by naming them [...]

    System variables that take a numeric value can be specified as --var_name=value on the command line or as var_name=value in option files.

    Many system variables can be changed at runtime (see Section 5.1.5.2, “Dynamic System Variables”).

    The innodb_ft_min_token_size is not a dynamic variable so you will have to change the config file my.cnf and add innodb_ft_min_token_size=6. Alternatively you need to change the startup command of your MySQL server.

    After the change you must restart your MySQL server.