Linux Ï MysqlÅäÖÃÎÊÌ⼯
Ò»Ö±ÒÔÀ´ÎÒµÄÎÄÕ¶¼ÊÇÒÔ¹¤×÷±Ê¼ÇµÄÐÎʽ´æÔÚ¡£Õâ¶ÔÓÚ×Ô¼º¶ÁÆðÀ´Ã»Ê²Ã´´ó°£¬µ«ÊǶÔÓÚÆäËû¶ÁÕß¿ÉÄܾÍÓÐЩÃÔã¡£ÎÒ¾¡Á¿¸Ä¸Ä£¬»»ÖÖ·½Ê½¡£
1. MySQL µÄ°æ±¾
Èç¹ûÒªÖ§³Ö·ÖÇø±í£¬ÔòÓ¦¸ÃʹÓà 5.1.x ÒÔÉϵİ汾¡£Èç
mysql> show variables like '%version%';
+-------------------------+------------------------------+
| Variable_name | Value |
+-------------------------+------------------------------+
| protocol_version | 10 |
| version | 5.1.45-community-log |
| version_comment | MySQL Community Server (GPL) |
| version_compile_machine | x86_64 |
| version_compile_os | unknown-linux-gnu |
+-------------------------+------------------------------+
2. MySQL µÄ»ù±¾²ÎÊýÉ趨
´Ë´¦Éæ¼°µÄ²ÎÊýÊÇÔÚÓ¦ÓÃÖв»¶Ï¸üеġ£ÈçÏÂΪ /etc/my.cnf ²¿·ÖÄÚÈÝ
[mysqld]
datadir=/var/lib/mysql
datadir=/home/mysql/data
socket=/var/lib/mysql/mysql.sock
user=mysql
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
#old_passwords=1
#mysql 5.0 --log-slow-queries
#log-slow-queries=/var/log/mysql/slowquery.log
#log-queries-not-using-indexes=/var/log/mysql/noindex.log
#mysql 5.1
slow_query_log=1
slow_query_log_file=/var/log/mysql/slowquery.log
log-queries-not-using-indexes=1
#´´½¨Ï̳߳ØÀ´´¦Àí´óÁ´½ÓÁ¿µÄÓ¦ÓÃ
thread_cache_size=80
#¼Ó¿ì¿Í»§¶ËÁ´½ÓËÙ¶È,¿ÉÒÔÆÁ±ÎµôËùÓеÄip·´Ïò½âÎö
#µ±Ê±×¢Òâµ½´ËÎÊÌ⣬ÊÇÒòΪÔÚ show processlist µÄʱºò£¬·¢ÏÖÁË´óÁ¿µÄ user = 'unauthenticated user'Á´½Ó´æÔÚ¡£
#ÕâÊÇÒòΪmysqlÔÚ¿Í»§¶ËÁ´½Óʱ£¬»á·´Ïò²éѯipµÄhostname,
Ïà¹ØÎĵµ£º
´´½¨×ÀÃæͼ±ê
Ä¿Ç°½«ÍøÂçÓ¦ÓÃÀ©Õ¹µ½×ÀÃæÊÇÒ»¸öÇ÷ÊÆ£¬´æÔÚןܶà½â¾ö·½°¸£¬±¾ÎÄÒÔ Mozilla Prism ΪÀý£¬ÀàËƵķ½·¨Í¬ÑùÊÊÓÃÓÚ Google Chrome ¡£
1. µ½ Mozilla Prism µÄÍøÕ¾ÉÏÏÂÔØ Prism£¬µã»÷ Download Now Ö®ºó»áÌáʾÓÐÁ½ÖÖ£¬Ò»ÖÖÊÇÒÔ Mozilla Firefox À©Õ¹µÄ·½Ê½£¬ÊʺÏÒѾ°²×°ÓÐ Firefox µÄÅóÓÑ£»Ò»Ö ......
1¡¢´ò¿ªMyEclipse6.6
2¡¢Ñ¡Ôñ²Ëµ¥£ºWindow/Open Perspective/MyEclipse Database Explorer£¬µã»÷OK£¬ÔÚ×ó±ß´ò¿ªDB Brower´°¿Ú¡£
3¡¢ÔÚDB Brower´°¿ÚÄÚÈÎÒâ¿Õ°×´¦»÷ÓÒ¼ü£¬Ñ¡ÔñNewÃüÁµ¯³öDatabase Driver´°¿Ú
4¡¢±¾´°¿Ú¸÷Ïî˵Ã÷£º
Driver template: MySQL Connector/J Ñ¡ÔñÇý¶¯Ä£°å
& ......
ÔÚ´¦ÀíÒ»¸ö´óÊý¾ÝÁ¿Êý¾Ý¿âµÄʱºò
ͻȻ·¢ÏÖmysql¶ÔÓÚcount(*)µÄ²»Í¬´¦Àí»áÔì³É²»Í¬µÄ½á¹û
±ÈÈçÖ´ÐÐ
SELECT count(*) from tablename
¼´Ê¹¶ÔÓÚǧÍò¼¶±ðµÄÊý¾ÝmysqlÒ²Äܷdz£Ñ¸Ëٵķµ»Ø½á¹û
¶ø¶ÔÓÚ
SELECT count(*) from tablename WHERE…..
mysqlµÄ²éѯʱ¼ä¿ªÊ¼ÅÊÉý
×Ðϸ²éÔÄÀÛÏÂÊÖ²á,·¢ÏÖµ±Ã»ÓÐWHEREÓï¾ä¶ÔÓÚÕ ......
1.ÓÅ»¯ÄãµÄMySQL²éѯ»º´æ
ÔÚMySQL·þÎñÆ÷ÉϽøÐвéѯ£¬¿ÉÒÔÆôÓøßËÙ²éѯ»º´æ¡£ÈÃÊý¾Ý¿âÒýÇæÔÚºǫ́ÇÄÇĵĴ¦ÀíÊÇÌá¸ßÐÔÄܵÄ×îÓÐЧ·½·¨Ö®Ò»¡£µ±Í¬Ò»¸ö²éѯ±»Ö´Ðжà´Îʱ£¬Èç¹û½á¹ûÊÇ´Ó»º´æÖÐÌáÈ¡£¬ÄÇÊÇÏ൱¿ìµÄ¡£
µ«Ö÷ÒªµÄÎÊÌâÊÇ£¬ËüÊÇÄÇôÈÝÒ×±»Òþ²ØÆðÀ´ÒÔÖÁÓÚÎÒÃÇ´ó¶àÊý³ÌÐòÔ±»áºöÂÔËü¡£ÔÚÓÐЩ´¦ÀíÈÎÎñÖУ¬ÎÒÃÇʵ¼ÊÉÏÊÇ¿ÉÒÔ×è ......
ÒýÓÃ
×÷Õß:GuCuiwen email:win2linux@163.com
ºÜ¶àLINUX³õѧÕß·Ö²»Çå³þlinuxºÍXÖ®¼ä,XºÍXfree86Ö®¼ä,XºÍKDE,GNOMEµÈÖ®¼äÊÇʲô¹Øϵ.³£³£»ìÏý¸ÅÄî,ÎÒÏëÒԱȽÏÒ×ÓÚÀí ½âµÄ·½Ê½ËµÃ÷Ò»ÏÂX,X11,XFREE,WM,KDE,GNOMEµÈÖ®¼äµÄ¹Øϵ.ÓÉÓÚ±¾ÈËˮƽÓÐÏÞ¿ÉÄÜ´æÔÚ´íÎó,Çë¸ßÊÖÖ¸Õý.
Ò»,linux±¾ÉíûÓÐͼÐνçÃæ,linuxÏÖÔÚµÄÍ ......