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

MySQLµ÷ÓÅ£­±àÒëƪ

°²×°Ê±µÄÓÅ»¯
(ÒÔϲâÊÔÊý¾Ý¶¼À´×ÔÓÚmysqlµÄ¹Ù·½ÍøÕ¾)
²»ÒªÓÃrpm»òÆäËû¶þ½øÖÆ·½Ê½°²×°
ÒªÓÃÔ´´úÂë×Ô¼º±àÒë
Èç¹ûÊDZ¼ÌÚϵͳ£¬ÍƼöÓÃpgcc±àÒëÆ÷
ÇÒʹÓÃ-O6µÄ±àÒë²ÎÊý
ÕâÑù±à³öÀ´µÄmysql±ÈÓÃgcc2.95µÄÒª¿ì1%
½öÓÃÓõÃ×ŵÄ×Ö·û¼¯±àÒëMySql
mysqlÄ¿Ç°Ö§³Ö¶à´ï34ÖÖ²»Í¬µÄ×Ö·û¼¯(mysql4.1.11)
µ«ÎÒÃdz£ÓõÄÒ²Î޷ǾÍÊÇlatin1¡¢gbk¡¢utf8ÕâÈýÖÖ¶øÒÑ
ËùÒÔÒ»°ãÓñàÒë²ÎÊý
–with-charset=latin1 –with-extra-charsets=gbk,utf8
¾ÍÐÐ
Óþ²Ì¬·½Ê½±àÒëmysqld
ÓñàÒë²ÎÊý
–with-mysqld-ldflags=-all-static
ÔÚlinuxϽ«»áÌá¸ß13%µÄËÙ¶È
±àÒëʱ²»ÒªÓòÎÊý–with-debug»òÕßÊÇ–with-debug=all
–with-debug=allÖÂʹ¼¸ºõËùÓеIJéѯÂý20%£¬ÓеĸüÉõ
½öÊÇ–with-debugÒ²»á´øÀ´15%µÄ²éѯËÙ¶ÈϽµ
Èç¹û±àÒëµÄʱºò¼ÓÁË–with-debug=all²ÎÊý
ÄÇô¿ÉÒÔÓÖskip-safemallocÀ´Æô¶¯·þÎñÆ÷
ÕâÑùËÙ¶ÈÓ°Ïì¸ú–with-debug²î²»¶à
ÔÚÅÜÔÚx86ÉϵÄlinuxÏÂÓÃgcc²»ÓÃframe pointers±àÒë
Ò²¾ÍÊÇÓòÎÊý-fomit-frame-pointer
»òÕßÊÇ-fomit-frame-pointer -ffixed-ebp
ÕâÑù»áʹmysqld¿ì1-4%
ÓÃÃüÁîstrip mysqld stripÒ»ÏÂmysqldµÄ¶þ½øÖÆÎļþ½«»áÌá¸ß4%µÄËÙ¶È
ÓÃunix socketÀ´Á¬±¾»úµÄmysql·þÎñÆ÷±ÈÓÃtcp/ipÒª¿ì7.5%
(unixÏ£¬Á¬Ö÷»úÃûlocalhostȱʡÓõÄÊÇunix socket)
ËùÒÔ½ö´Ó±¾»úÀ´Á¬µÄmysql·þÎñÆ÷
¿ÉÒÔÓòÎÊý–skip-networkingÀ´Æô¶¯(½«²»¼àÌý3306¶Ë¿Ú)
ÓÃtcp/ipÀ´Á¬Ô¶³ÌµÄmysql·þÎñÆ÷±ÈÁ¬±¾µØµÄmysql·þÎñÆ÷ÒªÂý8-11%
É÷ÖØʹÓÃsecure connection(ËùÓÐÊý¾Ý¶¼»á±»sslÖ§³Ö¼ÓÃÜ)
ÒòΪÕâÑù»á±È²»¼ÓÃÜÂý55%
Êý¾Ý¿âÉè¼ÆʱµÄÓÅ»¯
²»ÒªÓÃISAMÀàÐͱí
ISAMÊÇmysql×îÔçµÄ±íÀàÐÍ£¬Ò²ÊÇ·ÇÊÂÎñÐÔ±íÀàÐÍ
ÏÖÔÚÒѾ­±»MyISAM±íÀàÐÍËùÈ¡´ú
MySQL4.1µÄ°æ±¾ÀïËäÈ»»¹±£ÁôµÄÓÐISAM±íÀàÐÍ
µ«ÒѾ­²»ÍƼöʹÓÃ
´ÓMysql5¿ªÊ¼£¬ISAM±íÀàÐÍÒѱ»É¾µô
Mysql´Ó3.23¿ªÊ¼ÒýÈëMyISAMºÍHEAP±íÀàÐÍ
MyISAMÓÃÀ´Ìá¸ßISAM±íÀàÐÍÐÔÄÜ
HEAP¾ÍÊÇËùνÄÚ´æ±í
Mysql´Ó3.23.25¿ªÊ¼ÒýÈëMERGE±íÀàÐÍ
ÕâÖÖ±íÀàÐÍÔÊÐí°ÑһЩMyISAM±íµ±×÷Ò»¸ö±íÀ´²Ù×÷
MyISAM¡¢HEAP¡¢MERGEÕâÈýÖÖ±íÀàÐͶ¼ÊÇ·ÇÊÂÎñÐÔ±íÀàÐÍ
×¢£ºHEAP±íÀàÐÍÒѸÄÃûΪMEMORY±íÀàÐÍ
InnoDBºÍBDBÊÇËùνµÄÊÂÎñÐÔ±íÀàÐÍ
Ò²¾ÍÊÇÖ§³Ö»Ø¹öµÄ±íÀàÐÍ
´óÔ¼´ÓMysql3.23ºóÃæµÄһЩ°æ±¾¿ªÊ¼±»Ö§³Ö
´ÓMysql4.0¿ªÊ¼±»È±Ê¡Ö§³Ö
EXAMPLE±íÀàÐÍ´ÓMysql4.1.3¿ªÊ¼±»ÒýÈë
ËûÆäʵûʲôÓÃ
¼È²»


Ïà¹ØÎĵµ£º

mysql£ºÍò¶ñµÄÂÒÂëÖ®whenÓï¾äÖвúÉúµÄÂÒÂë

ʹÓÃmysqlÓÖÓöµ½ÎÊÌâÁË£¬Õâ´ÎÊǹØÓÚÂÒÂëµÄ...
ÆäʵÎÒÒ²±È½ÏÁ˽â±àÂëµÄÎÊÌ⣬Ҳ֪µÀÂÒÂë²úÉúµÄÔ­Àí£¬¶øÇÒÍøÉ϶ÔmysqlµÄÂÒÂëÎÊÌâÒ²ÓбȽ϶àµÄ½â´ð£¬
µ«ÊǽñÌìÎÒÓöµ½µÄÕâ¸öÂÒÂëÈ´±È½ÏÆæ¹Ö,ÔÚwhenÓï¾äÖвúÉúÁËÆæ¹ÖµÄÂÒÂë¡£
create table my_table(id int, name varchar(50), born DateTime);
insert into my_table val ......

MySQLµÄ²éѯÓÅ»¯ºÜɵ

select id from message where author_id in (select followed_id from Relation where follower_id=1) order by id desc   ºÍ ·Ö±ðÖ´ÐÐ $userlist = select followed_id from Relation where follower_id=1 ÔÙ select id from message where author_id in ($userlist) order by id desc   ¾¹È»ÓÐÁ½¸öÊýÁ ......

Mysql ¶¨Òå×ֶεij¤¶È

 
Mysql Öж¨Òå×ֶκóµÄÊý¾ÝµÄÓô¦£º
int(1)ºÍint(10)ËƺõûÓÐʲô²î±ð£¬¶¼±íʾ×î´óËĸö×Ö½ÚµÄÕûÐÍÊý¾Ý¡£
ÀýÈ綨ÒåÒ»¸öÃû×ÖΪtestµÄ±í:
DROP TABLE IF EXISTS `test`;
CREATE TABLE `test` (
  `id` int(1) NOT NULL,
  `ids` int(10) default NULL,
  `c` char(1) default NULL,
  `cs` ......

ÔÚMySqlÖÐÌí¼ÓÔ¶³Ì³¬¼¶Óû§

1. ʹÓÃGRANTÓï¾äÌí¼Ó£ºÊ×ÏÈÔÚÊý¾Ý¿â±¾»úÉÏÓÃROOTÓû§
µÇ¼MySql£¨ÎÒÊÇÓÃÔ¶³Ì¿ØÖÆlinux·þÎñÆ÷£¬Ï൱ÓÚÔÚ·þÎñÆ÷±¾»úµÇ¼MySqlÁË£©£¬È»ºóÊäÈ룺
mysql>GRANT ALL PRIVILEGES ON *.* TO admin@localhost IDENTIFIED BY 'something' WITH GRANT OPTION;
Ìí¼ÓÒ»¸öÓû§admin²¢ÊÚȨͨ¹ý±¾µØ»ú£¨localhost)·ÃÎÊ£¬ÃÜÂë“s ......

ÐÞ¸ÄmysqlÃÜÂëµÄ·½·¨

use mysql
update user set Password=password('newpassword') where User='root';
flush privileges;
1.ͨ¹ýÐÞ¸ÄMYSQLÊý¾Ý¿âÖÐMYSQL¿âµÄUSER±í
¾ÍÓÃÆÕͨµÄUPDATE¡¢INSERTÓï¾ä¾Í¿ÉÒÔ
2.ÔÚÃüÁîÐÐÖÐʹÓÃÈçÏÂÃüÁî
MYSQLADMIN -u root -p PASSWORD mypasswd
3.¿ÉÒÔÐÞ¸ÄMYSQLÎļþ¼ÐÖеÄMY.INIÎļþ
4.ʹÓÃSET PASSWORDÓï¾ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ