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

½«MySQLÊý¾ÝÓ³Éäµ½MemcachedÖÐ

²î²»¶àÔÚÒ»ÄêÇ°£¬Ð´¹ýһƪÎÄÕ½éÉܽ«MySQLÊý¾ÝÓ³Éäµ½Memcached£¬µ±Ê±MySQLºÍMemcached Functions for MySQL¶¼»¹²»¹»³ÉÊ죬ʱ¹ýÒ»Ä꣬Memcached Functions for MySQLÉý¼¶µ½ÁË0.8°æ±¾£¬¶øMySQLÒ²·¢²¼ÁËGA°æ±¾£¬¼ÓÉϺܶàÅóÓÑ·´Ó¦Ç°Ò»ÆªÎÄÕÂÖеÄʵÏÖËûÃÇÒòÖÖÖÖÔ­ÒòûÄܳɹ¦£¬ÓÚÊDZãÓÐÁËÕâƪÎÄÕ£¬¾Íµ±ÊÇÉÏһƪÎÄÕµÄÉý¼¶°æ±¾°É¡£
²âÊÔ»·¾³ÔÚLinuxϽøÐУ¬°æ±¾ÏµÍ³ÎªCentOS5.
ÒÔÏÂΪÏà¹ØÈí¼þ£¬°üÀ¨Æä°æ±¾ºÍÏÂÔصØÖ·£º
mysql-5.1.30 ÏÂÔØ
memcached-1.2.6 ÏÂÔØ
libevent-1.4.7-stable ÏÂÔØ
memcached_functions_mysql-0.8 ÏÂÔØ
libmemcached-0.26 ÏÂÔØ
±àÒë°²×°MySQL,°²×°Òò¸öÈËϸºÃ¶ø¶¨£¬Ê¡ÂÔÐí¶àÓë²âÊÔÎ޹صıàÒëϸ½Ú¼°²ÎÊý¡£
[root@localhost ~]#tar xzf mysql-5.1.30.tar_001.gz
[root@localhost ~]#cd mysql-5.1.30
[root@localhost ~]#./configure --prefix=/usr/local/mysql51
[root@localhost ~]#make
[root@localhost ~]#make install
[root@localhost ~]#./scripts/mysql_install_db --user=mysql --skip-name-resolve
[root@localhost ~]#/usr/local/mysql51/bin/mysqld_safe
Ê¡ÂÔÁгö°²×°memcachedºÍlibeventµÄÏà¹ØÃüÁ¾ßÌå¿É°´ÕÕʵ¼ÊÇé¿ö°²×°£¬²âÊÔʱÎÒ½«libeventĬÈÏ°²×°£¬memcached°²×°ÓÚ/usr/local/memcachedĿ¼Ï¡£
Æô¶¯memcached.
/usr/local/memcached/bin/memcached -d -m 50 -u root -p 11211
±àÒë°²×°libmemcache.
[root@localhost ~]#tar xzf libmemcached-0.26.tar.gz
[root@localhost ~]#cd libmemcached-0.26
[root@localhost ~]#./configure --with-memcached=/usr/local/memcached/bin/memcached
[root@localhost ~]# make && make install

±àÒë°²×°Memcache UDFs for MySQL.
[root@localhost ~]# tar xzf memcached_functions_mysql-0.8.tar.gz
[root@localhost ~]# cd memcached_functions_mysql-0.8
[root@localhost ~]# ./configure --with-mysql-config=/usr/local/mysql51/bin/mysql_config
[root@localhost ~]# make && make install
±àÒëÍê³Éºó½«±àÒëºÃµÄ¿âÎļþ¸´ÖƵ½mysqlµÄ²å¼þĿ¼Ï£¬ÒÔ±ãÓÚ¼ÓÔØʹÓá£
cp /usr/local/lib/libmemcached_functions_mysql* /usr/local/mysql51/lib/mysql/plugin/
½øÈëmemcached_functions_mysqlµÄÔ´ÂëĿ¼£¬ÔÚĿ¼ÏÂÓÐÏà¹ØÌí¼ÓUDFµÄSQLÎļþÓÃÓÚ³õʼ»¯¡£
[root@localhost ~]# mysql <sql/install_functions.sql
×¢£ºÈç


Ïà¹ØÎĵµ£º

ÕýÈ·Àí½âMysqlµÄÁÐË÷ÒýºÍ¶àÁÐË÷Òý

  MysqlÊý¾Ý¿âÌṩÁ½ÖÖÀàÐ͵ÄË÷Òý£¬Èç¹ûûÕýÈ·ÉèÖã¬Ë÷ÒýµÄÀûÓÃЧÂÊ»á´ó´òÕÛ¿ÛÈ´ÍêÈ«²»ÖªÎÊÌâ³öÔÚÕâ¡£
CREATE TABLE test (
id INT NOT NULL,
last_name CHAR(30) NOT NULL,
first_name CHAR(30) NOT NULL,
PRIMARY KEY (id),
INDEX name (last_name,first_name)
);
ÒÔÉÏ´ ......

mysql Æ𶯴íÎó½â¾ö°ì·¨

mysql Æ𶯴íÎó½â¾ö°ì·¨- -
                                      
Access denied for user ''@'localhost' to d ......

°²×°mysqlÓöµ½µÄÎÊÌâ

 Ê×ÏÈÐèҪжÔØredhat×Ô´øµÄmysqlÊý¾Ý¿â£¨²»È»°²×°Ê±»á³öÎÊÌ⣩
rpm -qa|grep mysql
È»ºó rpm -e °üÃû³Æ
Èç¹ûÉæ¼°µ½ÒÀÀµ£¬¾ÍÏÈɾ³ýÒÀÀµ£¬»òÕß¼Ó¸ö -nodeps ²ÎÊýºöÂÔÒÀÀµ
ÓÐÍøÓÑ˵ÓÃyum -y remove mysqlÒ²¿ÉÒÔ
ÁíÒ»¸ö½â¾ö·½·¨Ê±ÔÚlinux×Ô´ømysql»ù´¡ÉÏÔÙװеÄmysql
¶þ½øÖÆ°²×°°ü°æ±¾ºÜ¶à£¬³£ÓõľÍÁ½¸ö£¬ÎÒϵÄÊÇ ......

MySQLÊý¾Ý¿â±¸·ÝºÍ»¹Ô­µÄ³£ÓÃÃüÁî


±¸·ÝMySQLÊý¾Ý¿âµÄÃüÁî
mysqldump -hhostname -uusername -ppassword databasename > backupfile.sql
±¸·ÝMySQLÊý¾Ý¿âΪ´øɾ³ý±íµÄ¸ñʽ
±¸·ÝMySQLÊý¾Ý¿âΪ´øɾ³ý±íµÄ¸ñʽ£¬Äܹ»Èøñ¸·Ý¸²¸ÇÒÑÓÐÊý¾Ý¿â¶ø²»ÐèÒªÊÖ¶¯É¾³ýÔ­ÓÐÊý¾Ý¿â¡£
mysqldump -–add-drop-table -uusername -ppassword databasename > bac ......

mysql alter Óï¾äÓ÷¨,Ìí¼Ó¡¢Ð޸ġ¢É¾³ý×ֶεÈ

mysql alter Óï¾äÓ÷¨,Ìí¼Ó¡¢Ð޸ġ¢É¾³ý×ֶεÈ
//Ö÷¼ü549830479
alter table tabelname add new_field_id int(5) unsigned default 0 not null auto_increment ,add primary key (new_field_id);
//Ôö¼ÓÒ»¸öÐÂÁÐ549830479
alter table t2 add d timestamp;
alter table infos add ex tinyint not null default ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ