Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

sphinxÕûºÏµ½mysql(master/slave)ÖÐ

sphinx°æ±¾Ê¹ÓõÄÊÇcoreseekÐ޸ĵÄÖ§ ³ÖÖÐÎļìË÷µÄ°æ±¾,ÖÐÎÄ´Ê¿âʹÓà coreseek¿ª·¢µÄlibmmseg
mysqlÊÜsphinxÖÐsphinxseÒýÇæÒªÇó°²×°ÁËmysql-5.0.37×öÉú²ú»·¾³µÄmysql-5.0.70µÄ´Ó¿â
±àÒësphinx,libmmsegÒÔ¼°mysql:
±àÒë°²×°libmmseg:
./configure --prefix=/usr/local/mmseg && make -j5 && make install
copy ½âѹËõºóµÄsphinxĿ¼ÖеÄmysqlseÖеÄÎļþµ½mysqlϵÄsql/sphinx/ÖÐ
¸ømysql´òsphinxµÄ²¹¶¡
patch -p1 < sql/sphinx/sphinx.5.0.37.diff
±àÒëmysql:
./configure --prefix=/data/app/mysql --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --with-readlin
e --with-big-tables --enable-local-infile --with-sphinx-storage-engine --without-innobase
make -j5 && make install
±àÒësphinx
CPPFLAGS=-I/usr/include/python2.5 LDFLAGS=-lpython2.5 ./configure --prefix=/data/app/sphinx --with-mysql=/data/app/mysql --with-mmse
g=/data/app/mmseg --with-mmseg-includes=/data/app/mmseg/include/mmseg --with-mmseg-libs=/data/app/mmseg/lib
make -j5 && make install
ÅäÖÃmysqlÖ÷´Ó
.master -> slave
Éú³É×ÖµäÎļþ:
mmseg -u unigram.txt
mv unigram.txt.lib /data/app/dict/uni.lib
ÅäÖÃsphinx.conf
source source_name {...} #×öÈ«ÎļìË÷µÄÄÚÈÝÔ´
source source_name_increase:source_name {...} #×öÔöÁ¿¼ìË÷µÄÔ´
index index_name {...} #×öË÷ÒýµÄÅäÖÃ
index index_name_increase:index_name {...} #×öÔöÁ¿Ë÷ÒýµÄÅäÖÃ
indexer {...} #indexer½ø³ÌµÄÉèÖÃ
searched {...} #searched½ø³ÌµÄÉèÖÃ
½¨Á¢ÔÚÔöÁ¿Ë÷ÒýÐèҪʹÓõÄÊý¾Ý±íÒÔ¼°SPHINXÒýÇæÐèÒªµÄ±í:
CREATE TABLE `sphcounter` (
`counterid` int(11) NOT NULL,
`max_doc_id` int(11) NOT NULL,
PRIMARY KEY (`counterid`)
) ENGINE=MyISAM
CREATE TABLE `sphinx` (
`id` int(11) NOT NULL,
`weight` int(11) NOT NULL,
`query` varchar(255) NOT NULL,
KEY `Query` (`query`)
) ENGINE=SPHINX DEFAULT CHARSET=utf8 CONNECTION='sphinx://localhost:3312/cbid_index';
½¨Á¢Æô¶¯½Å±¾ÒÔ¼°½¨Á¢Ë÷ÒýµÄ½Å±¾:
#!/bin/bash
/data/app/sphinx/bin/indexer --all --config /data/app/sphinx/etc/sphinx.conf
sphinx.increase
#!/bin/bash
/dat


Ïà¹ØÎĵµ£º

MYSQLÒѾ­ÉúЧµÄÉèÖúÍ״̬²éѯÃüÁî

ÒÔÏÂÃüÁî¿ÉÒÔÔÚÈκÎÒѾ­Á¬½ÓÉÏMYSQL·þÎñÆ÷µÄ¿Í»§¶ËÉÏÖ´ÐС£
show full processlist ;
kill 57725;#ɱµôÉÏÃæ²éµ½µÄij¸öµ¼ÖÂ×èÈûµÄÁ¬½Ó
SELECT @@profiling;
SET profiling = 1;
SHOW PROFILES;
SHOW PROFILE for QUERY 1;
#ϵͳÉèÖÃ
show variables like '%key%';
show variables like '%key%';
show variables l ......

LinuxÏÂMySQL5.1µÄ°²×°

×î½üÏëÔÚ·þÎñÆ÷ÉÏÊÔÊÔMySQL5.1µÄ·ÖÇø£¬ÓÚÊǾÍÏë×Å×°¸öMySQL5.1£¬¾­¹ýÍ´¿àµÄÒ»¶Î¾­Àúºó£¬ÖÕÓÚÕÒ¸öÏÂÃæ×°¸öºÜºÃµÄ½Ì³Ì£¬ÌûÉÏÀ´±¸Íü¡£
1¡¢MySQLÃâ°²×°°æ/¶þ½øÖÆ°æÈí¼þ£¬²»ÓñàÒ룬ÏÂÔصØÖ·£º
     http://dev.mysql.com/downloads/
     Îļþ¸ñʽ£ºMYSQL-VERSION-OS.tar.gz
2¡¢´ ......

MySQLѧϰ±Ê¼Ç

Ò»¡¢MySQL»ù±¾ÃüÁºÏ£º
1¡¢  create database mydata£»//´´½¨Êý¾Ý¿â
2¡¢  use mydata; //ÔÚmydataÕâ¸öÊý¾Ý¿âϹ¤×÷
3¡¢  create table dept    //ÔÚmydataÊý¾Ý¿âÏ´´½¨±ídept
(
deptno int primary key,
dname varchar(14),
loc varchar(13)
);
 
create table emp  / ......

MySQLÁÙʱ±í½¨Á¢

MySQL½¨Á¢ÁÙʱ±íµÄÓï¾äÈçÏÂ:
CREATE TEMPORARY TABLE tmp (
article INT(4) UNSIGNED ZEROFILL DEFAULT '0000' NOT NULL,
price DOUBLE(16,2) DEFAULT '0.00' NOT NULL);
--LOCK TABLES article read;
--ÏȲåÈëÊý¾Ýµ½ÁÙʱ±í
INSERT INTO tmp SELECT article, MAX(price) from shop GRO ......

MysqlÊý¾ÝÀàÐÍ


ÊýÖµÀàÐÍ
¡¡¡¡MySQL
µÄÊýÖµÊý¾ÝÀàÐÍ¿ÉÒÔ´óÖ»®·ÖΪÁ½¸öÀà±ð£¬Ò»¸öÊÇÕûÊý£¬ÁíÒ»¸öÊǸ¡µãÊý»òСÊý¡£Ðí¶à²»Í¬µÄ×ÓÀàÐͶÔÕâЩÀà±ðÖеÄÿһ¸ö¶¼ÊÇ¿ÉÓõģ¬Ã¿¸ö×ÓÀàÐÍÖ§³Ö²»Í¬´óСµÄÊý¾Ý£¬²¢ÇÒ
MySQL ÔÊÐíÎÒÃÇÖ¸¶¨ÊýÖµ×Ö¶ÎÖеÄÖµÊÇ·ñÓÐÕý¸ºÖ®·Ö»òÕßÓÃÁãÌî²¹¡£
¡¡¡¡±íÁгöÁ˸÷ÖÖÊýÖµÀàÐÍÒÔ¼°ËüÃǵÄÔÊÐí·¶Î§ºÍÕ¼ÓõÄÄÚ´æ¿Õ¼ä¡ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ