MySQL Ë÷ÒýdzÎö
ÔÎÄÁ´½Ó£ºhttp://hi.baidu.com/171892549/blog/item/14818d0ac616ee34b1351dbd.html
ÔÚÊý¾Ý¿â±íÖУ¬Ê¹ÓÃË÷Òý¿ÉÒÔ´ó´óÌá¸ß²éѯËٶȡ£
¼ÙÈçÎÒÃÇ´´½¨ÁËÒ»¸ö testIndex ±í£º
CREATE TABLE testIndex(i_testID INT NOT NULL,vc_Name VARCHAR(16) NOT NULL);
ÎÒÃÇËæ»úÏòÀïÃæ²åÈëÁË 1000 Ìõ¼Ç¼£¬ÆäÖÐÓÐÒ»Ìõ i_testID vc_Name 555 erquan
ÔÚ²éÕÒ vc_Name="erquan" µÄ¼Ç¼ SELECT * from testIndex WHERE vc_Name='erquan'; ʱ£¬Èç¹ûÔÚvc_Name ÉÏÒѾ½¨Á¢ÁËË÷Òý£¬MySql ÎÞÐëÈκÎɨÃ裬¼´×¼È·¿ÉÕÒµ½¸Ã¼Ç¼£¡Ïà·´£¬MySql »áɨÃèËùÓмǼ£¬¼´Òª²éѯ 1000¡£ÒÔË÷Òý½«²éѯËÙ¶ÈÌá¸ß 100 ±¶¡£
Ò»¡¢Ë÷Òý·Öµ¥ÁÐË÷ÒýºÍ×éºÏË÷Òý
µ¥ÁÐË÷Òý£º¼´Ò»¸öË÷ÒýÖ»°üº¬µ¥¸öÁУ¬Ò»¸ö±í¿ÉÒÔÓжà¸öµ¥ÁÐË÷Òý£¬µ«Õâ²»ÊÇ×éºÏË÷Òý¡£×éºÏË÷Òý£º¼´Ò»¸öË÷°üº¬¶à¸öÁС£
¶þ¡¢½éÉÜÒ»ÏÂË÷ÒýµÄÀàÐÍ
1¡¢ÆÕͨË÷Òý¡£
ÕâÊÇ×î»ù±¾µÄË÷Òý£¬ËüûÓÐÈκÎÏÞÖÆ¡£ËüÓÐÒÔϼ¸ÖÖ´´½¨·½Ê½£º
£¨1£©´´½¨Ë÷Òý£ºCREATE INDEX indexName ON tableName(tableColumns(length));Èç¹ûÊÇCHAR£¬VARCHARÀàÐÍ£¬length¿ÉÒÔСÓÚ×Ö¶Îʵ¼Ê³¤¶È;Èç¹ûÊÇ BLOB ºÍ TEXT ÀàÐÍ£¬±ØÐëÖ¸¶¨ length£¬ÏÂͬ¡£
£¨2£©Ð޸ıí½á¹¹£ºALTER tableName ADD INDEX [indexName] ON (tableColumns(length))
£¨3£©´´½¨±íµÄʱºòÖ±½ÓÖ¸¶¨£ºCREATE TABLE tableName ( [...], INDEX [indexName] (tableColumns(length)) ;
2¡¢Î¨Ò»Ë÷Òý¡£
ËüÓëÇ°ÃæµÄ"ÆÕͨË÷Òý"ÀàËÆ£¬²»Í¬µÄ¾ÍÊÇ£ºË÷ÒýÁеÄÖµ±ØÐëΨһ£¬µ«ÔÊÐíÓпÕÖµ¡£Èç¹ûÊÇ×éºÏË÷Òý£¬ÔòÁÐÖµµÄ×éºÏ±ØÐëΨһ¡£ËüÓÐÒÔϼ¸ÖÖ´´½¨·½Ê½£º
£¨1£©´´½¨Ë÷Òý£ºCREATE UNIQUE INDEX indexName ON tableName(tableColumns(length))
£¨2£©Ð޸ıí½á¹¹£ºALTER tableName ADD UNIQUE [indexName] ON (tableColumns(length))
£¨3£©´´½¨±íµÄʱºòÖ±½ÓÖ¸¶¨£ºCREATE TABLE tableName ( [...], UNIQUE [indexName] (tableColumns(length));
3¡¢Ö÷¼üË÷Òý
ËüÊÇÒ»ÖÖÌØÊâµÄΨһË÷Òý£¬²»ÔÊÐíÓпÕÖµ¡£Ò»°ãÊÇÔÚ½¨±íµÄʱºòͬʱ´´½¨Ö÷¼üË÷Òý£ºCREATE TABLE testIndex(i_testID INT NOT NULL AUTO_INCREMENT,vc_Name VARCHAR(16) NOT NULL,PRIMARY KEY(i_testID)); µ±È»Ò²¿ÉÒÔÓà ALTER ÃüÁî¡£¼Çס£ºÒ»¸ö±íÖ»ÄÜÓÐÒ»¸öÖ÷¼ü¡£
4¡¢È«ÎÄË÷Òý
MySQL ´Ó 3.23.23 °æ¿ªÊ¼Ö§³ÖÈ«ÎÄË÷ÒýºÍÈ«ÎļìË÷¡£
ɾ³ýË÷ÒýµÄÓï·¨£ºDROP INDEX index_name ON tableName
Èý¡¢µ¥ÁÐË÷ÒýºÍ×éºÏË÷Òý
ΪÁËÐÎÏóµØ¶Ô±ÈÁ½Õߣ¬ÔÙ½¨Ò»¸ö±í£º
CREATE TABL
Ïà¹ØÎĵµ£º
from:http://www.ccvita.com/100.html
mysql 5.0´æ´¢¹ý³Ìѧϰ×ܽá
Ò».´´½¨´æ´¢¹ý³Ì
1.»ù±¾Óï·¨£º
create procedure sp_name()
begin
………
end
2.²ÎÊý´«µÝ
¶þ.µ÷Óô洢¹ý³Ì
1.»ù±¾Óï·¨£ºcall sp_name()
×¢Ò⣺´æ´¢¹ý³ÌÃû³ÆºóÃæ±ØÐë¼ÓÀ¨ºÅ£¬ÄÄŸô洢¹ý³ÌûÓвÎÊý´«µÝ
Èý.ɾ³ý´æ´¢¹ý³Ì
1 ......
²Ù×÷Êý¾Ý¿â
µÇ¼µ½mysqlÖУ¬È»ºóÔÚmysqlµÄÌáʾ·ûÏÂÔËÐÐÏÂÁÐÃüÁÿ¸öÃüÁîÒԷֺŽáÊø¡£
1¡¢ ÏÔʾÊý¾Ý¿âÁÐ±í¡£
show databases;
ȱʡÓÐÁ½¸öÊý¾Ý¿â£ºmysqlºÍtest¡£ mysql¿â´æ·Å×ÅmysqlµÄϵͳºÍÓû§È¨ÏÞÐÅÏ¢£¬ÎÒÃǸÄÃÜÂëºÍÐÂÔöÓû§£¬Êµ¼ÊÉϾÍÊǶÔÕâ¸ö¿â½øÐвÙ×÷¡£
2¡¢ ÏÔʾ¿âÖе ......
°²×°MySQL
sudo apt-get install mysql-server mysql-admin mysql-navigator mysql-query-browser
Õâ¸öÓ¦¸ÃºÜ¼òµ¥ÁË£¬¶øÇÒÎÒ¾õµÃ´ó¼ÒÔÚ°²×°·½ÃæҲûʲô̫´óÎÊÌ⣬ËùÒÔÒ²¾Í²»¶à˵ÁË£¬ÏÂÃæÎÒÃÇÀ´½²½²ÅäÖá£
ÅäÖÃMySQL
×¢Ò⣬ÔÚUbuntuÏÂMySQLȱʡÊÇÖ»ÔÊÐí±¾µØ·ÃÎʵģ¬Èç¹ûÄãÒªÆäËû»úÆ÷Ò²Äܹ»·ÃÎʵĻ°£¬ÄÇôÐèÒª¸Ä±ä/etc/m ......
http://www.javaeye.com/topic/211951
Õâ¶Îʱ¼äÔÚ¿´¡¶High Performance MySQL¡·£¬¿´µ½´æ´¢ÒýÇæÕâ¸öµØ·½¸Ðµ½ºÜ¶àϸ½Ú±È½ÏÄ°Éú£¬ËùÒÔ×ܽáС¼ÇһЩ
ΪÁËÊÊÓ¦¸÷ÖÖ²»Í¬µÄÔËÐл·¾³£¬MYSQLÌṩÁ˶àÖÖ²»Í¬µÄ´æ´¢ÒýÇ棨Storage Engine £©,ÔÚÓ¦ÓóÌÐò¿ª·¢Õâ¸ö²ãÃæÉÏ£¬¿ª·¢Õß¿ÉÒÔ¸ù¾Ý²»Í¬µÄÐèÇóÑ¡ÔñÊʺϵÄStorage Engine ·½°¸£¬¸üΪÁ ......
ÎÒÔÚ°²×°XAMPP 1.7.0ʱ£¬°²×°³É¹¦ºó£¬´òËãÆô¶¯XAMPP¡£Apache˳ÀûÆô¶¯£¬µ«ÊÇMySqlÔõô¶¼Æô¶¯²»ÁË£¬ÌáʾµÄ´íÎóÊÇ£º
error:mysql service not started [-1]
ÎÒÖØÐÂ×°Á˼¸´Î¶¼²»ÐУ¬ÏÂÔØÁËÆäËûµÄ°æ±¾Ò²²»ÐУ¬ÎÒÕæ¸ã²»Çå³þΪʲô¡£ÎÒGoogleÁË°ëÌ죬ÆðÏÈʱÖÐÎÄÍøÒ³£¬°´ÕÕ¼¸¸ö½â¾ö·½·¨×öÁ˶¼²»ÐУ¬¿Ï¶¨ÊÇûÓжÔÖ¢ÏÂÒ©°Ñ£¬È»ºóÎÒµ ......