简体   繁体   English

如何更改只读权限以设置MySQL服务器系统变量的新值

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

I am new to MySQL; 我是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. 我读到了InnoDB参数,但无法解决问题。

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. 采用数值的系统变量可以在命令行中指定为--var_name = value,或者在选项文件中指定为var_name = value。

Many system variables can be changed at runtime (see Section 5.1.5.2, “Dynamic System Variables”). 许多系统变量可以在运行时更改(请参见第5.1.5.2节“动态系统变量”)。

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 . innodb_ft_min_token_size不是动态变量,因此您必须更改配置文件my.cnf并添加innodb_ft_min_token_size=6 Alternatively you need to change the startup command of your MySQL server. 或者,您需要更改MySQL服务器的启动命令。

After the change you must restart your MySQL server. 更改后,您必须重新启动MySQL服务器。

Try this: In /etc/mysql/my.cnf file(location in your case could be different, do locate my.cnf to find the location for your system), add/modify: 试试这个:在/etc/mysql/my.cnf文件中(在你的情况下位置可能不同, locate my.cnf找到你系统的位置),添加/修改:

[mysqld]
innodb_ft_min_token_size = 2

to set the minimum limit to 2. Don't forget to restart the mysql server and rebuilding the fulltext index. 将最小限制设置为2.不要忘记重新启动mysql服务器并重建全文索引。 For me, the following worked like a charm. 对我来说,以下工作就像一个魅力。

drop index index_stem on  maps;
CREATE FULLTEXT INDEX index_stem ON maps(stem_value);

As of MySQL 5.7.5, the innodb_buffer_pool_size configuration option can be set dynamically using a SET statement, allowing you to resize the buffer pool without restarting the server. 从MySQL 5.7.5开始,可以使用SET语句动态设置innodb_buffer_pool_size配置选项,允许您在不重新启动服务器的情况下调整缓冲池的大小。 For example: 例如:

mysql> SET GLOBAL innodb_buffer_pool_size=402653184;

https://dev.mysql.com/doc/refman/5.7/en/innodb-buffer-pool-resize.html https://dev.mysql.com/doc/refman/5.7/en/innodb-buffer-pool-resize.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM