MySqlµÄ¸÷ÖÖÒýÇæ
1.MemoryÒýÇæ,ÌṩÄÚ´æ±í
MySql Memory´æ´¢ÒýÇ棨ÀÏ°æ±¾Ò²½Ð×öheap´æ´¢ÒýÇ棩£¬¹ËÃû˼ÒåÊÇÔÚÄÚ´æÖд洢ËùÓеÄÊý¾Ý£¬Ëü¾ßÓÐÒÔÏÂÁ½¸öÃ÷ÏÔÌØÕ÷£º
¢ÙÄÚ´æÖд洢Êý¾Ý£¬·Ç³£¸ßËÙ;
¢Úmysql¹Ø±ÕºóËùÓÐÊý¾ÝÏûʧ£¬mysqlÆô¶¯Ê±»á´´½¨¿Õ±í;
memory´æ´¢ÒýÇæÒ²ÊÇÒ»¸ö¾ø¼ÑµÄcache½â¾ö·½°¸£¬±¾Éíjdbc²Ù×÷¾ÍºÜÈÝÒ×±»java³ÌÐòÔ±½ÓÊÜ£»¶øÇÒ¿ÉÒÔ¶ÔÒÑÓеÄһЩ³ÌÐòÔÚ¼«ÉÙ¸Äд´ú
ÂëµÄÇé¿öÏÂÀ´Ìá¸ßÐÔÄÜ£¬ÀýÈç¶ÔһЩ³£ÓÃ×ÊÔ´µÄ²éѯÈçÊ¡ÊÐÐÅÏ¢£¬Èç¹ûÒÔÍùÊÇͨ¹ýÖ±½Ó²éѯÊý¾Ý£¬ÏÖÔÚ¸ÄΪ´ÓÄÚ´æ±íÖжÁÈ¡£¬¼¸ºõÊÇûÓÐ
ÈκθÄÔì³É±¾µÄ£»ÇÒmysqlµÄÒ×ÓÃÐÔÒ²ÃâÈ¥Á˶ÔÆäËûcache·þÎñÆ÷µÄѧϰ³É±¾¡£
×¢Ò⣺
µ±ÄÚ´æ±íÖеÄÊý¾Ý´óÓÚmax_heap_table_sizeÉ趨µÄÈÝÁ¿´óСʱ£¬mysql»áת»»³¬³öµÄÊý¾Ý´æ´¢µ½´ÅÅÌÉÏ£¬Òò´ËÕâÊÇÐÔÄܾʹó´òÕÛ¿Û
ÁË£¬ËùÒÔÎÒÃÇ»¹ÐèÒª¸ù¾ÝÎÒÃǵÄʵ¼ÊÇé¿öµ÷Õûmax_heap_table_size£¬ÀýÈçÔÚ.cnfÎļþÖÐ[mysqld]µÄÏÂÃæ¼ÓÈ룺
max_heap_table_size = 2048M
ÁíÍâÔÚ½¨±íÓï¾äÖл¹¿ÉÒÔͨ¹ýMAX_ROWSÀ´¿ØÖƱíµÄ¼Ç¼Êý¡£
ÈçºÎ´´½¨ÄÚ´æ±í£¿
´´½¨ÄÚ´æ±í·Ç³£µÄ¼òµ¥£¬Ö»Ðè×¢Ã÷ ENGINE= MEMORY ¼´¿É:
CREATE TABLE `tablename` ( `columnName` varchar(256) NOT NUL) ENGINE=MEMORY DEFAULT
CHARSET=latin1 MAX_ROWS=100000000;
2.MyISAM¹ÜÀí·ÇÊÂÎñ±í
ËüÌṩ¸ßËÙ´æ´¢ºÍ¼ìË÷£¬ÒÔ¼°È«ÎÄËÑË÷ÄÜÁ¦¡£MyISAMÔÚËùÓÐMySQLÅäÖÃÀï±»Ö§³Ö£¬ËüÊÇĬÈϵĴ洢ÒýÇ棬³ý·ÇÄãÅäÖÃMySQLĬÈÏʹÓÃ
ÁíÍâÒ»¸öÒýÇæ
3.InnoDBºÍBDB´æ´¢ÒýÇæÌṩÊÂÎñ°²È«±í
4.EXAMPLE´æ´¢ÒýÇæÊÇÒ»¸ö“´æ¸ù”ÒýÇæ
Ëü²»×öʲô¡£Äã¿ÉÒÔÓÃÕâ¸öÒýÇæ´´½¨±í£¬µ«Ã»ÓÐÊý¾Ý±»´æ´¢ÓÚÆäÖлò´ÓÆäÖмìË÷¡£Õâ¸öÒýÇæµÄÄ¿µÄÊÇ·þÎñ£¬ÔÚMySQLÔ´´úÂëÖеÄÒ»¸öÀý
×Ó£¬ËüÑÝʾ˵Ã÷ÈçºÎ¿ªÊ¼±àдд洢ÒýÇ档ͬÑù£¬ËüµÄÖ÷ÒªÐËȤÊǶԿª·¢Õß
Ïà¹ØÎĵµ£º
MysqlÂÒÂë²úÉúµÄÔÒò£º
²úÉú´ËÀàÎÊÌâµÄ×î¿ÉÄÜÊÇÄãµÄÊý¾Ý¿âÔÚ°²×°Ê±Ã»ÓÐÑ¡¶Ô×Ö·û¼¯£¬Õâ¸öÊ®·ÖÖØÒª.
Äã¿ÉÒÔͨ¹ýÈçϵķ½Ê½À´²é¿´£º´ò¿ªMysql´°¿Ú£¬ÔÚ´°¿ÚµÄ×î×óÉϽǵã»÷Êó±êÓÒ¼ü£¬Ñ¡ÔñÊôÐÔ£¬¾Í¿ÉÒÔ¿´µ½ÄãĬÈϵÄ×Ö·û±àÂëÁË£¨ÈçÏÂͼ£©£º
......
×î´óµÄÎïÆ·ºÅÊÇʲô£¿
SELECT MAX(article) AS article from shop;
ÈÎÎñ£ºÕÒ³ö×î¹óÎïÆ·µÄ±àºÅ¡¢ÏúÊÛÉ̺ͼ۸ñ¡£
ÕâºÜÈÝÒ×ÓÃÒ»¸ö×Ó²éѯ×öµ½£º
SELECT article, dealer, price
from shop
WHERE price=(SELECT MAX(price) from shop);
ÁíÒ»¸ö½â¾ö·½°¸ÊÇ°´¼Û¸ñ½µÐòÅÅÐòËùÓÐÐв¢ÓÃMySQLÌض¨LIMIT×Ó¾äÖ» ......
1¡¢´´½¨mysqlÊý¾Ý¿âµÄ¹ÜÀíÓû§
Êý¾Ý¿â°²×°ºÃºó£¬ÎÒÃÇÓ¦¸ÃΪmysqlÊý¾Ý¿â´´½¨Ò»¸ö¹ÜÀíÕʺš£Òª°ÑrootÓû§ÉèÖÃΪ¹ÜÀíÔ±£¬´ËʱÐèÒªÖ´ÐÐÏÂÃæÃüÁ
[root@CDS2 bin]# /usr/bin/mysqladmin -u root password 123456
˵Ã÷£ºÉÏÃæ´´½¨µÄmysqlÊý¾Ý¿â¹ÜÀíԱΪroot£¬ÃÜÂë123456
2¡¢´´½¨Ò»°ãµÄÓû§
¹¤×÷ÖÐÓõ½web·þÎñÆ÷ºÍmysql·þÎñÆ ......
½ñÌ죬ÓÃNavicatΪÁ½ÕÅ±í½¨Á¢Í⽡¹Øϵ£¬×ÜÊÇÌáʾ´´½¨Ê§°ÜÐÅÏ¢£¬·¢ÏÖÊÇÁ½Õűí¹ØÁªµÄ×Ö¶ÎÀàÐÍÎÊÌ⣬µ«Á½¸ö×ֶζ¼ÊÇintÐÍÁ¨£¬Ôõô»á»¹»áÀàÐͲ»Ò»ÖÂÄØ£¬×îºó·¢ÏÖµ½Ò»¸öµØ·½Óе㲻һÑù£¬¾ÍÊÇÔÚ“Éè¼Æ±í”½çÃæÏ·½Óиö“ÎÞ·ûºÅ”µÄ¸´Ñ¡¿ò£¬Á½ÕűíµÄÖ÷¼ü×Ö¶ÎÆäÖÐÒ»¸öû¹´Ñ¡ÉÏÕâ¸ö¸´Ñ¡¿ò¶øµ¼ÖÂËäÈ»¶¼ÊÇintÀàÐÍ£ ......
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| test &n ......