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

MysqlÓÅ»¯¼¼ÇÉ

×ܽáÁËһЩMySQLÓÅ»¯·½ÃæµÄ¼¼ÇÉ
Ò». Æô¶¯²ÎÊýÓÅ»¯
ÐÞ¸Ä my.cnf (»òÕßmy.ini)£¬¼ÓÈë/ÐÞ¸ÄÒÔϼ¸ÐÐ
#É趨»º´æµÄÁ¬½ÓÊý,½ÚÊ¡Á¬½ÓʱµÄ¿ªÏú
back_log = 64
#½ûÓÃÎļþϵͳÍⲿËø
external-locking = 0
#½ûÓÃBDB,Èç¹ûÄãȷʵ²»ÐèÒªµÄ»°,innodbÒ²ÊÇÈç´Ë
skip-bdb
#Ë÷Òý»º³å,Èç¹ûÊÇרÓõÄÊý¾Ý¿â·þÎñÆ÷,¿ÉÒÔÉèÖøߴï·þÎñÆ÷ÄÚ´æµÄÒ»°ë,Èç¹û²»ÊÇרÓõÄ,
#»¹ÊÇÉèÖõõÍÒ»µã
key_buffer = 512M
#»º´æÊý¾Ý±íÊýÁ¿,Èç¹ûÄÚ´æ½Ï´ó,¿ÉÒÔÉèÖÃÉÔ΢¸ßÒ»µã,·ñÔò»¹ÊÇÉèÖõÍÒ»µã
#ÉèÖÃÕâ¸ö²ÎÊý¿ÉÒԲμûϵͳ״̬ÖÐµÄ open_tables(±íʾµ±Ç°´ò¿ªµÄÊý¾Ý±í×ÜÊý)
#ºÍ opened_tables(±íʾËùÓдò¿ªµÄÊý¾Ý±í×ÜÊý)
table_cache = 128
#½ûÓÃdns½âÎö,Èç¹ûÄãµÄÊÚȨÐÅÏ¢ÖвÉÓÃdnsÊÚȨ·½Ê½ÁË,¾Í²»ÄÜÆôÓøÃÑ¡Ïî
skip-name-resolve
#¼Ç¼Âý²éѯºÍûÓÐʹÓÃË÷ÒýµÄ²éѯ,±ãÓÚ°ïÖú·ÖÎöÎÊÌâËùÔÚ
long_query_time = 1
log-slow-queries = /usr/local/mysql/data/slow.log
log-queries-not-using-indexes
ÆäËû²ÎÊýÖîÈç sort_buffer_size,net_buffer_length,read_buffer_size,read_rnd_buffer_size,myisam_sort_buffer_size,
thread_cache_size,query_cache_size,max_binlog_cache_size µÈÇë²éѯMySQLÊÖ²á,È»ºó×ö³öºÏÊʵĵ÷Õû.
¶þ. ÆäËûСTIPS
* Õë¶ÔInnodb±í,¾¡Á¿²»Ö´ÐÐ SELECT COUNT(*) Óï¾ä,ÒòΪInnodb±íûÓÐÀàËÆMyISAMÄÇÑùµÄÄÚ²¿¼ÆÊýÆ÷À´¼Ç¼±í¼Ç¼×ÜÁ¿,Ö´ÐÐÕâ¸ö²Ù×÷½«»áÈ«±íɨÃè,ËٶȺÜÂý.
* ¾¡Á¿Ê¹ÓÃMyISAM±í,³ý·Ç±ØÐëʹÓÃÆäËûÀàÐÍ,ÒòΪMyISAMÀàÐ͵Ä×ÜÌå¶ÁдЧÂÊÊÇÏ൱¸ßµÄ,ȱµãÊÇ±í¼¶Ëø,¶ø²»ÊÇÐÐ/Ò³¼¶Ëø.
* ÉÆÓà EXPLAINÀ´°ïÖúÄã·ÖÎö²éѯÓÅ»¯Çé¿ö
* Èç¹ûÐèÒª¶ÔÒ»¸ö½Ï´óµÄÇÒ²¢·¢¶Áд½Ï¶àµÄÊý¾Ý±í×ö GROUP BY µÈͳ¼Æ²Ù×÷,½¨ÒéʹÓÃÕªÒª±íÀ´´æ´¢Í³¼ÆÐÅÏ¢,¶¨ÆÚ¸üÐÂͳ¼Æ±í,Õâ¿ÉÄÜ»ñµÃºÜ´óµÄÐÔÄܸÄÉÆ.
* ²éѯʱÈç¹ûÓÐ ORDER BY·Ö¾äµÄ»°,×¢ÒâÈÃËüµÄ×Ö¶Î˳ÐòºÍË÷Òý×Ö¶Î˳Ðò¶ÔÓ¦,ÕâÑùÄܼӿìÅÅÐòËÙ¶È
* Èç¹ûÓÐÒ»¸ö¶à×Ö¶ÎË÷Òý,Ôò²éѯʱ,±ØÐë°´ÕÕË÷Òý˳ÐòÀ´Ê¹ÓÃ,·ñÔò¸ÃË÷Òý²»»áÓõ½.ÀýÈç:
Ë÷Òý `idx_`(col1, col2, col3),ÄÇô²éѯ SELECT .... from ... WHERE col1=1 AND col2=2; ʹÓÃË÷Òý,¶ø²éѯ ... WHERE col2=2 AND col3=3; »ò ... WHERE col1=1 AND col3=3; Ôò²»Ê¹ÓÃË÷Òý.
* WHERE ÖеÄÌõ¼þÈç¹ûÓкãÁ¿ÀàÐ͵Ä(Èç `field` = 1),¾Í¾¡Á¿·ÅÔÚÇ°Ãæ,ÕâÑùÄܸü¿ìµÄÖ´ÐйýÂË.
* 2 ¸ö±íÁ¬½Óʱ,Á¬½Ó×ֶεÄÀàÐÍ×îºÃÒ»ÖÂ(°üÀ¨×ֶ㤶È),ÕâÑùµÄ»°Ë÷ÒýËٶȿì¶àÁË.
* ´ó²¿·ÖÇé¿öÏÂ,×Ö·ûÀàÐ͵


Ïà¹ØÎĵµ£º

mysql Ë÷Òý


 
 
²é¿´Ä³¸ö±íµÄ½¨±íÓï¾ä £ºshow create table data_statdata;
drop index ts on data_statdata;
Ë÷ÒýÊǼÓËÙ²éѯµÄÖ÷ÒªÊֶΣ¬Ìرð¶ÔÓÚÉæ¼°¶à¸ö±íµÄ²éѯ¸üÊÇÈç´Ë¡£±¾½ÚÖУ¬½«½éÉÜË÷ÒýµÄ×÷Óá¢Ìص㣬ÒÔ¼°´´½¨ºÍɾ³ýË÷ÒýµÄÓï·¨¡£
13.4.1 ʹÓÃË÷ÒýÓÅ»¯²éѯ
Ë÷ÒýÊÇ¿ìËÙ¶¨Î»Êý¾ÝµÄ¼¼Êõ£¬Ê×ÏÈͨ¹ýÒ»¸öʾÀýÀ´Á˽ ......

ʹÓà MySQL Workbench ¿ÉÊÓ»¯µÄÉè¼Æ MySQL Êý¾Ý¿â

Ó¢ÎÄÔ­ÎÄ£º
http://www.packtpub.com/article/visual-mysql-database-design-in-mysql-workbench
ÏÂÃæÊDz¿·Ö·­Òë¹ýÀ´µÄ£¬×ªÔØ×Ô£ºhttp://zuolo.info/2008/11/%e4%bd%bf%e7%94%a8-mysql-workbench-%e5%8f%af%e8%a7%86%e5%8c%96%e7%9a%84%e8%ae%be%e8%ae%a1-mysql-%e6%95%b0%e6%8d%ae%e5%ba%93-1%e8%af%91%e6%96%87/
MySQL ......

MySQL phpMyAdmin °²×°

Ê×ÏÈ°²×°phpMyadmin
[root@aladdin phpMyAdmin]# uname -a
Linux aladdin.leadtek.com.cn 2.6.32.11-99.fc12.i686.PAE #1 SMP Mon Apr 5 16:15:03 EDT 2010 i686 i686 i386 GNU/Linux
[root@aladdin phpMyAdmin]# yum info phpmyadmin
Loaded plugins: presto, refresh-packagekit
Installed Packages
Name &nbs ......

mysql replication


<!--
/* Font Definitions */
@font-face
{font-family:Courier;
panose-1:2 7 4 9 2 2 5 2 4 4;
mso-font-alt:"Courier New";
mso-font-charset:0;
mso-generic-font-family:modern;
mso-font-format:other;
mso-font-pitch:fixed;
mso-font-signature:3 0 0 0 1 0;}
@font-face
{f ......

mysql µ¼Èëµ¼³öÊý¾Ý·½·¨

1:>;create databases newname(ÔÚеÄserverÉϽ¨Á¢¿ÕµÄÊý¾Ý¿â)
2:#/usr/local/mysql/bin/mysqldump databasename >;*.sql(ÔھɵķþÎñÆ÷Éϵ¼³öÊý¾Ý¿â)
3:#/usr/local/mysql/bin/mysql databasename < *.sql(ÔÚеķþÎñÆ÷Éϵ¼Èë*.sql) ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ