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

¸ßÐÔÄÜMySqlѧϰ±Ê¼Ç(Ò»)

¸ßÐÔÄÜMySqlѧϰ±Ê¼Ç
1.Õë¶ÔÓ¦Óý¨Á¢×Ô¼ºµÄË÷Òý
URL²éÕÒÀý×Ó
    select * from tUrl where url='http://www.163.com';
ÒÔurl£¨×Ö·û´®£©×÷ÐÐΪË÷Òý»áʹµÃ×÷ΪË÷Òý½á¹¹µÄB-Tree±ä´ó£¬¿ÉÒÔÒƳýurlÁÐÉϵÄË÷Òý£¬²¢Ìí¼ÓÒ»¸öurl_crcË÷ÒýÁУ¬
ÏȽ¨Á¢±í£º
create tables tUrl(
    id int unsigned NOT NULL auto_increment,
    url varchar(255) NOT NULL,
    url_crc int unsigned NOT NULL DEFAULT 0,
    primary key(id)
);
ͨ¹ýÒÔÏ·½Ê½²éѯ£º
    mysql> select * from queryHash where url_crc=CRC32( 'http://www.163.com' ) and url='http://www.163.com' ; 
1.url_crcÁеÄË÷ÒýÐÔÄܽϸß
2.ÔÚÓгåÍ»µÄʱºò£¬ÔÙͨ¹ý¾«È·±È½ÏµÃµ½ËùÐèÒªÁÐ
3.Èç¹û³åÍ»¹ý¶à¿ÉÒÔ¸ÄÓÉ64λµÄhash, MD5()/SHA1(), ½ØÈ¡Ç°16ʾÀýÈçÏ£º
  mysql> select conv( right ( md5('http://www.csdn.net'), 16), 16, 10) as hash64;
select conv( right ( md5('http://www.csdn.net'), 16), 16, 10) as hash64;
+---------------------+
| hash64              |
+---------------------+
| 9270541833456602998 |
+---------------------+
×¢£ºMaatkit( http://www.maatkit.org/)°üº¬ÁËÒ»¸öÓû§×Ô¶¨Ò庯Êý(UDF)£¬ÊµÏÖÁËFowler/Noll/Vo64λ¹þÏ£º¯Êý£¬Ëٶȷdz£¿ì¡£
ÉÏÊö·½·¨È±µãÊÇÒªÊÖ¹¤Î¬»¤hashÖµ£¬¿ÉÒÔͨ¹ýʹÓô¥·¢Æ÷ά»¤,·Ö±ðΪinsert/updateÌí¼Ó´¥·¢Æ÷£º
delimiter |
create trigger url_crc_ins before insert on tUrl for each row begin
set NEW.url_crc=crc32(NEW.url);
end;
|
create trigger url_crc_upd before update on tUrl for each row begin
set NEW.url_crc=crc32(NEW.url);
end;
|
delimiter ;
Ñé֤һϣº
 
mysql> insert into tUrl(url) values( 'http://www.csdn.net' );
mysql> select * from tUrl;
+----+---------------------+------------+
| id | url                 | url_crc    |
+----+---------------------+------------+
|  2 | http://www.csdn.net | 3


Ïà¹ØÎĵµ£º

¿ªÆôMysqlÊý¾Ý¿âInnoDB

½â¾öThe‘InnoDB’feature is disabled; you need MySQL built with ‘InnoDB’ to have it2009Äê12ÔÂ29ÈÕ ÐÇÆÚ¶þ ÉÏÎç 11:15MySQL
³öÏÖÈçÏÂÓï¾ä£ºThe ‘InnoDB’ feature is disabled; you need MySQL built with ‘InnoDB’ to have it working£»
ÊÇmysqlÅäÖÃÎļþ½ûµôÁËÕâ¸öÑ¡ ......

MysqlÖÐÎÊ×Ö·ûÏÖʵÂÒÂëºÍÎÞ·¨Ìí¼ÓÖÐÎÄÊý¾ÝÎÊÌâ

      ½ñÌìÖÕÓÚÕÒµ½×Ô¼ºµ÷ÊÔÉÐѧÌÃshoppingÏîĿʱµÄÎÊÌâËùÔÚÁË£¬Í¨¹ý²é×ÊÁÏ£¬¶ÔmyeclipseºÍtomcatµÄ²¿ÊðÓÖÓÐÁ˸üÉîÒ»¸ö²ã´ÎµÄÁ˽⣬³ÌÐòµ÷ͨÁË£¬ÐË·ÜÁËÒ»ÏÂÏ£¬¹þ¹þ¡£¡£
      È¥ºǫ́Ìí¼ÓÊý¾Ý·¢ÏÖ´ÓmysqlÖжÁ³öµÄÖÐÎÄÈ«²¿ÏÖʵΪ¿É°®µÄÎʺţ¬ÕâϺÃÁË£¬ÎÒÐÄÀïÒ²²úÉúÎʺŠ......

ʹÓÃhibernateÓëmysqlʱÊý¾Ý²»ÄܲåÈëµÄÔ­Òò¼°½â¾ö°ì·¨

1.±³¾°     
      Ö®Ç°´ÓûÓùýhibernate£¬Òò´ËÔÚÍøÉÏËÑÁËÒ»ÏÂhibernate¿ìËÙÈëÃÅ·½ÃæµÄÐÅÏ¢£¬×îºóÎÒ°´ÕÕ¡¶Myeclipse Hibernate ¿ìËÙÈëÃÅ ÖÐÎÄ°æ¡·£¨CSDN£¬°Ù¶ÈÎĿⶼÓУ©Ò»ÎÄ¿ªÊ¼ÁËÎÒµÄhibernateÖ®Âã¨ÎªÏîÄ¿×ö¼¼Êõ×¼±¸£©¡£
      ÏÂÃ ......

MysqlÖ¸Á showÓ÷¨

MySQL showµÄÓ÷¨
   
a. show tables»òshow tables from database_name; // ÏÔʾµ±Ç°Êý¾Ý¿âÖÐËùÓбíµÄÃû³Æ
   b. show databases; // ÏÔʾmysqlÖÐËùÓÐÊý¾Ý¿âµÄÃû³Æ
   c. show columns from table_name from database_name; »òshow columns from database_name.table_name;  ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ