XAMPP MySQL-设置ft_min_word_len [英] XAMPP MySQL - Setting ft_min_word_len
问题描述
我在计算机上安装了XAMPP,并且正在本地主机上通过它使用MySQL进行个人项目.
I have XAMPP installed on my computer, and am using MySQL through it on localhost for a personal project.
我正在尝试将布尔模式下的全文搜索的ft_min_word_len变量设置为2,默认值是4.
I am trying to set the ft_min_word_len variable for fulltext searches in boolean mode to 2 from the default of 4.
我已经尝试过(从XAMPP控制面板停止MySQL之后):
I've tried (after stopping MySQL from the XAMPP control panel):
-
从XAMPP控制面板中打开Shell,然后在提示符下键入:
mysqld ft_min_word_len = 2
当我随后使用 mysqld --help --verbose 检查它的值时,这似乎对ft_min_word_len没有任何影响(当我尝试使用 mysqladmin变量出现提示.)
Opening Shell from the XAMPP control panel, and typing at the prompt:
mysqld ft_min_word_len=2
This doesn't appear to have any effect on ft_min_word_len when I check its value afterwards with mysqld --help --verbose (I get an error when I try to use mysqladmin variables at the prompt).
使用以下文本在XAMPP \ mysql \ bin中创建my.cnf文件:
#MySQL服务器
[mysqld]
ft_min_word_len = 2
当我使用 mysqld --help --verbose 检查ft_min_word_len的值时,确实会改变ft_min_word_len的值.但是,当我再次从XAMPP的控制面板启动MySQL并检查通过PHPMyAdmin和 SHOW VARIABLES LIKE'ft_min_word_len'设置的ft_min_word_len的值,在重建全文索引之前和之后仍为4.
Creating a my.cnf file in XAMPP\mysql\bin with this text:
# The MySQL server
[mysqld]
ft_min_word_len=2
This does appear to change the value of ft_min_word_len when I check its value with mysqld --help --verbose.
However, when I start MySQL again from XAMPP's control panel, and then check the value of ft_min_word_len through PHPMyAdmin with SHOW VARIABLES LIKE 'ft_min_word_len', it is still 4, both before and after I rebuild the fulltext indexes.
在停止和启动MySQL之间,我多次尝试了每种方法. 类似于"ft_min_word_len"的"SHOW VARIABLES" 确实显示了2的值,但是下次我停止并重新启动MySQL时,该值已返回到4,并且无法再次将其设置为2.
I've tried each approach multiple times, in between stopping and starting MySQL. SHOW VARIABLES LIKE 'ft_min_word_len' did show a value of 2 once, but the next time I stopped and restarted MySQL, the value had returned to 4, and I have been unable to set it to 2 again.
任何朝着正确方向的指针都会受到赞赏.
Any pointers in the right direction would be appreciated.
推荐答案
将my.cnf
文件保存在<XAMPP>\mysql\bin
文件夹中,然后重试.
Keep you my.cnf
file in <XAMPP>\mysql\bin
folder and try again.
这篇关于XAMPP MySQL-设置ft_min_word_len的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!