bsp; = 3306
socket = /mysql/3306/mysql.sock
default-character-set = gbk
#init_connect = ''SET NAMES gbk''
skip-locking
#skip-slave-start
key_buffer = 512M
max_allowed_packet = 2M
table_cache = 1024
sort_buffer_size = 32M
read_buffer_size = 2M
read_rnd_buffer_size = 32M
max_length_for_sort_data = 64
myisam_sort_buffer_size = 128M
thread_cache = 8
query_cache_size = 64M
# Try number of CPU''s*2 for thread_concurrency
thread_concurrency = 8
#skip-name-resolve
set-variable = max_connections=1000
open_files_limit = 51200
ft_min_word_len = 1
low_priority_updates = 1
slave-skip-errors = 1032,1062,126
server-id = 9
#master-host = host
#master-user = user
#master-password = password
#master-port = 3306
#replicate-do-db = db1
#replicate-do-db = db2
[mysqldump]
quick
max_allowed_packet = 16M
[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates
[isamchk]
key_buffer = 256M
sort_buffer_size = 256M
read_buffer = 2M
write_buffer = 2M
[myisamchk]
key_buffer = 256M
sort_buffer_size = 256M
read_buffer = 2M
write_buffer = 2M
[mysqlhotcopy]
interactive-timeout
附:MySQL配置文件在全文索引应用中的优化
引用[mysqld]
# key_buffer 指定用于索引的缓冲区大小,在全文索引中,增加它可得到更好的索引处理与查询性能
key_buffer = 512M
# sort_buffer_size 为查询排序时所能使用的缓冲区大小,全文索引的SQL语句之后通常会使用ORDER BY排序,增加它可以加快SQL语句执行时间。该参数对应的分配内存是每连接独占,100个连接使用的内存将是32M*100=3200M
sort_buffer_size = 32M
# 对大于可用内存的表执行GROUP BY或ORDER BY操作,应增加read_rnd_buffer_size的值以加速排序操作后面的行读取
read_rnd_buffer_size = 64M
# 如果表出现故障或索引出错,REPAIR TABLE时用到的缓冲区大小
myisam_sort_buffer_size = 128M
# 确定使用的filesort算法的索引值大小的限值
max_length_for_sort_data = 64
# MySQL全文索引查询所用关键词最小长度限制(不要改变这项值)
ft_min_word_len = 1
# 降低UPDATE优先级,设置查询优先
low_priority_updates = 1
4、以mysql用户帐号的身份建立数据表
/usr/local/mysqlcft/bin/mysql_install_db --defaults-file=/mysql/3306/my.cnf --basedir=/usr/local/mysqlcft --datadir=/mysql/3306/data --user=mysql --pid-file=/mysql/3306/mysql.pid --skip-locking --port=3306 --socket=/mysql/3306/mysql.sock
5、启动MySQL
/bin/sh /usr/local/mysqlcft/bin/mysqld_safe --defaults-file=/mysql/3306/my.cnf &
附:停止MySQL
/usr/local/mysqlcft/bin/mysqladmin -u root -p -S /mysql/3306/mysql.sock shutdown
四、安装mysqlcft中文全文索引插件
1、从命令行登入MySQL服务器:
/usr/local/mysqlcft/bin/mysql -u root -p -S /mysql/3306/mysql.sock
2、查看MySQL插件目录的默认路径的SQL语句:
SHOW VARIABLES LIKE ''plugin_dir'';
3、下载mysqlcft中文全文索引插件,解压后拷贝mysqlcft.so文件到MySQL插件目录
①、32位Linux操作系统:
wget http://mysqlcft.googlecode.com/files/mysqlcft-1.0.0-i386-bin.tar.gz
tar zxvf mysqlcft-1.0.0-i386-bin.tar.gz
mkdir -p /usr/local/mysqlcft/lib/mysql/plugin/
cp mysqlcft.so /usr/local/my