MySQL by default requires minimum of 4 alphabets to perform a search.
Here is a way to modify the minimum number on CentOS:
# mysql -u root
# nano /etc/my.cnf
add the below line and save it, the number indicate the minimum length for the search, here we put 3.
ft_min_word_len=3
# service mysqld restart
rebuild the fulltext index of sql and it should work.
About this idea, you won't usually think about it until you really need it. Here is an example where you need it:
Assume you have a `table` with primary key `id` and you have `id` value 1 to 10000 stored in that table. When you are going up adds every `id` by 1, you may write
update `table` set `id`
The idea begins when I see hash index is only for MEMORY/HEAP/NDB, and PHP array is a simple hash table.
Sometimes, we use MYSQL to store enumerable values. However, it is not that easy to change available values for these fields. Instead, we create another table to store those availables values, ass
Attachment means files related to a text.
The purpose to store it in database, is to use foreign key to connect the text and attachment. So when the text is deleted, the attachment will be deleted automatically.
Since foreign key will be used, the table for text and table for attachment must both use
In MySQL, sometime we may write
where `attrib`&1=0
It means the LSB of `attrib` is 0.
However, it is different in C, because = have a higher precedence there, and we must use (attrib&1)==0 in C.
We'd better say, for those who is used to that [= have a higher precedence than & in C], it is mo
At some certain time, we may need to transfer data from MYSQL to MSSQL.
Tools is one choice.
If the above choice is difficult or not available, here are some steps to do that using SQL scripts:
Changing in scripts:
1. Export the old database as scripts for MYSQL.
2. Change "autoincrement" as "identity(1,
In MSSQL, we have row_number, and in MySQL, we have limit
Sometimes, the task is to find the record before and after a certain record. When the ordering is complex, it seems not easy for MySQL to do this, so row_number can be useful here.
But MySQL does not support row_number (when this entry is writt
- 2013
- 2012
- 2011
- 2010
