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

ͨ¹ý·ÖÇø£¨Partition£©ÌáÉýMySQLÐÔÄÜ

½ñÌìÕâô¼¤¶¯ÓÖÏëдÎÄÕµÄÔ­ÒòÊÇMySQL5.1µÄ·¢²¼´øÀ´ÁËÉè¼Æ³¬Ç¿¶¯Á¦Êý¾Ý¿âµÄÇ¿ÓÐÁ¦µÄÎäÆ÷£¬ÈκÎMySQLµÄDBA¶¼Ó¦¸Ã¾¡¿ìѧϰ²¢Ê¹ÓÃËü¡£ÎÒ¾õµÃÈç¹û­ÄܺܺõÎʹÓÃÕâ¸ö5.1°æ´øÀ´µÄÐÂÌØÐÔ£¬DBA¿ÉÒÔʹ×Ô¼º¹ÜÀíµÄVLDB£¨²»ÖªµÀʲôÊÇVLDB£¿¸æËßÄ㣬ÊǺôóºÃ´óµÄÊý¾Ý¿âµÄÒâ˼£¬Very Large DB£©»òÊý¾Ý²Ö¿âÆæ¼£°ãµÄ»ñµÃ¾Þ´óµÄÐÔÄÜÌáÉý¡£
¡¡¡¡Ê²Ã´ÊÇÊý¾Ý¿â·ÖÇø£¿
¡¡¡¡Êý¾Ý¿â·ÖÇøÊÇÒ»ÖÖÎïÀíÊý¾Ý¿âÉè¼Æ¼¼Êõ£¬DBAºÍÊý¾Ý¿â½¨Ä£ÈËÔ±¶ÔÆäÏ൱ÊìϤ¡£ËäÈ»·ÖÇø¼¼Êõ¿ÉÒÔʵÏֺܶàЧ¹û£¬µ«ÆäÖ÷ҪĿµÄÊÇΪÁËÔÚÌض¨µÄSQL²Ù×÷ÖмõÉÙÊý¾Ý¶Á­Ð´µÄ×ÜÁ¿ÒÔËõ¼õÏìӦʱ¼ä¡£
¡¡¡¡·ÖÇøÖ÷ÒªÓÐÁ½ÖÖÐÎʽ£º//ÕâÀïÒ»¶¨Òª×¢ÒâÐкÍÁеĸÅÄrowÊÇÐУ¬columnÊÇÁУ©
¡¡¡¡Ë®Æ½·ÖÇø£¨Horizontal Partitioning£©
¡¡¡¡ÕâÖÖÐÎʽ·ÖÇøÊǶԱíµÄÐнøÐзÖÇø£¬Í¨¹ýÕâÑùµÄ·½Ê½²»Í¬·Ö×éÀïÃæµÄÎïÀíÁзָîµÄÊý¾Ý¼¯µÃÒÔ×éºÏ£¬´Ó¶ø½øÐиöÌå·Ö¸î£¨µ¥·ÖÇø£©»ò¼¯Ìå·Ö¸î£¨1¸ö»ò¶à¸ö·ÖÇø£©¡£ËùÓÐÔÚ­±íÖж¨ÒåµÄÁÐÔÚÿ¸öÊý¾Ý¼¯Öж¼ÄÜÕÒµ½£¬ËùÒÔ±íµÄÌØÐÔÒÀÈ»µÃÒÔ±£³Ö¡£
¡¡¡¡¾Ù¸ö¼òµ¥Àý×Ó£ºÒ»¸ö°üº¬Ê®Ä귢Ʊ¼Ç¼µÄ±í¿ÉÒÔ±»·ÖÇøΪʮ¸ö²»Í¬µÄ·ÖÇø£¬Ã¿¸ö·ÖÇø°üº¬µÄÊÇÆäÖÐÒ»ÄêµÄ¼Ç¼¡££¨ÅóÞÈ×¢£ºÕâÀï¾ßÌåʹÓõķÖÇø·½Ê½ÎÒÃǺóÃæÔÙ˵£¬¿ÉÒÔÏȭ˵һµã£¬Ò»¶¨ÒªÍ¨¹ýij¸öÊôÐÔÁÐÀ´·Ö¸î£¬Æ©ÈçÕâÀïʹÓõÄÁоÍÊÇÄê·Ý£©
¡¡¡¡´¹Ö±·ÖÇø£¨Vertical Partitioning£©
¡¡¡¡ÕâÖÖ·ÖÇø·½Ê½Ò»°ãÀ´ËµÊÇͨ¹ý¶Ô±íµÄ´¹Ö±»®·ÖÀ´¼õÉÙÄ¿±ê±íµÄ¿í¶È£¬Ê¹Ä³Ð©Ìض¨µÄÁб»»®·Öµ½Ìض¨µÄ·ÖÇø£¬Ã¿¸ö·ÖÇø¶¼°üº¬ÁËÆäÖеÄÁÐËù¶ÔÓ¦µÄÐС£
¡¡¡¡¾Ù¸ö¼òµ¥Àý×Ó£ºÒ»¸ö°üº¬ÁË´ótextºÍBLOBÁÐµÄ±í£¬ÕâЩtextºÍBLOBÁÐÓÖ²»¾­³£±»·ÃÎÊ£¬Õâʱºò¾ÍÒª°ÑÕâЩ²»¾­³£Ê¹ÓõÄtextºÍBLOBÁË»®·Öµ½ÁíÒ»­¸ö·ÖÇø£¬ÔÚ±£Ö¤ËüÃÇÊý¾ÝÏà¹ØÐÔµÄͬʱ»¹ÄÜÌá¸ß·ÃÎÊËٶȡ£
¡¡¡¡ÔÚÊý¾Ý¿â¹©Ó¦ÉÌ¿ªÊ¼ÔÚËûÃǵÄÊý¾Ý¿âÒýÇæÖн¨Á¢·ÖÇø£¨Ö÷ÒªÊÇˮƽ·ÖÇø£©Ê±£¬DBAºÍ½¨Ä£Õß±ØÐëÉè¼ÆºÃ±íµÄÎïÀí·ÖÇø½á¹¹£¬²»Òª±£´æÈßÓàµÄÊý¾Ý£¨²»Í¬±íÖÐͬʱ¶¼°üº¬¸¸­±íÖеÄÊý¾Ý£©»òÏ໥Áª½á³ÉÒ»¸öÂß¼­¸¸¶ÔÏó£¨Í¨³£ÊÇÊÓͼ£©¡£ÕâÖÖ×ö·¨»áʹˮƽ·ÖÇøµÄ´ó²¿·Ö¹¦ÄÜʧЧ£¬ÓÐʱºòÒ²»á¶Ô´¹Ö±·ÖÇø²úÉúÓ°Ïì¡£
¡¡¡¡ÔÚMySQL 5.1ÖнøÐзÖÇø
¡¡¡¡MySQL5.1ÖÐ×¶¯ÈËÐĵÄÐÂÌØÐÔÓ¦¸Ã¾ÍÊǶÔˮƽ·ÖÇøµÄÖ§³ÖÁË¡£Õâ¶ÔMySQLµÄʹÓÃÕßÀ´ËµÈ·ÊµÊǸöºÃÏûÏ¢£¬¶øÇÒËýÒѾ­Ö§³Ö·ÖÇø´ó²¿·Öģʽ£º 
 ¡¡¡¡Range£¨·¶Î§£© –
¡¡¡¡ÕâÖÖģʽÔÊÐíDBA½«Êý¾Ý»®·Ö²»Í¬·¶Î§¡£ÀýÈçDBA¿ÉÒÔ½«Ò»¸ö±íͨ¹ýÄê·Ý»®·Ö³ÉÈý¸ö·Ö


Ïà¹ØÎĵµ£º

Linux ÏÂ×Ô¶¯±¸·ÝMYSQLÊý¾Ý¿âµÄshell ½Å±¾

MySQL :: Linux ÏÂ×Ô¶¯±¸·ÝÊý¾Ý¿âµÄ shell ½Å±¾
Linux ·þÎñÆ÷ÉϵijÌÐòÿÌ춼ÔÚ¸üРMySQL Êý¾Ý¿â£¬ÓÚÊǾÍÏëÆðдһ¸ö shell ½Å±¾£¬½áºÏ crontab£¬¶¨Ê±±¸·ÝÊý¾Ý¿â¡£Æäʵ·Ç³£¼òµ¥£¬Ö÷Òª¾ÍÊÇʹÓà MySQL ×Ô´øµÄ mysqldump ÃüÁî¡£
½Å±¾ÄÚÈÝÈçÏ£º
#!/bin/sh
# File: /home/mysql/backup.sh
# Database info
DB_NAME=" ......

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

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

Struts2+Spring+HibernateÁ¬½ÓmysqlÖÐÎÄÂÒÂë½â¾ö

1.struts.xmlÖÐÉèÖÃ
<constant name="struts.il8n.encoding" value="UTF-8"></constant>
2.jspÒ³ÃæÉèÖÃ
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
3.Êý¾Ý¿âÁ¬½Óurl
jdbc:mysql://localhost:3306/test?useUnicode=true&amp;characterEncoding=u ......

MySQL µ¼Èëµ¼³öÃüÁî

      ×î½ü±ðÈËÔÚ¸øÎÒ sql Îļþʱ¼òµ¥µÄÌáÁËÏ µ¼Èë/µ¼³ö ÃüÁÔÚ´Ë»ù´¡ÉÏѧϰÁËÏ£¬×ܽᵽ myhere¡£
    ¹æ¶¨£º
Óû§Ãû£ºdb_user
Õʺţº db_pass
Êý¾Ý¿â£º db_name
񡜧 table_name_1, table_name_2
    ˵Ã÷£º  һЩ²Ù×÷ÐèÒªÓÐÊʵ±µÄȨÏÞ¡£
1. ......

Çë×¢ÒâMYSQLÓï¾äÖеÄÒýºÅ

SQL #1: select * from uchome_feed where uid in('0',501...) order by dateline desc limit 0,50;
SQL #2: select * from uchome_feed where uid in(0,501...) order by dateline desc limit 0,50;
SQL #1  ÊÇCSDN ¸öÈË¿Õ¼ä»ñÈ¡¸öÈ˶¯Ì¬µÄSQL£¬ÊôUCHÔ­°æSQL¡£
SQL #2 ÊÇÈ¥µôµ¥ÒýºÅ(SQL #1ÖкìÉ«²¿·Ö)ºóµÄSQL£¬Á½¸ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ