2

I have XAMPP installed on my computer, and am using MySQL through it on localhost for a personal project.

I am trying to set the ft_min_word_len variable for fulltext searches in boolean mode to 2 from the default of 4.

I've tried (after stopping MySQL from the XAMPP control panel):

  • 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).

  • 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.

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.

Kami's Aibou
  • 327
  • 4
  • 13

2 Answers2

2

mysql config file would usually be found on in windows your installation drive:\XAMPP\mysql\bin\my.ini or

Linux under etc\my.cnf. if you does not get ft_min_word_len variable below the lines you simply add those line anywhere in the page

[mysqld]

ft_min_word_len = 3

then restart mysql server.

Mahedi Hasan
  • 178
  • 1
  • 11
1

Keep you my.cnf file in <XAMPP>\mysql\bin folder and try again.

Abhijeet Pathak
  • 1,948
  • 3
  • 20
  • 28
  • My apologies, that is where I had it - I just missed typing that in my question. (Edited so it's correct now.) – Kami's Aibou Sep 14 '10 at 05:26
  • 1
    I've added ft_min_word_len=2 to both my.cnf and my.ini and now correct value is being returned both at command prompt and in phpMyAdmin. – Abhijeet Pathak Sep 14 '10 at 07:00
  • Adding it into my.ini did it - thanks! Having it or not having it in my.cnf doesn't seem to be having any effect in phpMyAdmin. (Perhaps I'm missing something else that needs to be there in order for it to work from my.cnf.) – Kami's Aibou Sep 14 '10 at 07:56