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

MySQLÖÐMyISAMÒýÇæÓëInnoDBÒýÇæÐÔÄܼòµ¥²âÊÔ


[Ó²¼þÅäÖÃ]
CPU : AMD2500+ (1.8G)
ÄÚ´æ: 1G/ÏÖ´ú
Ó²ÅÌ: 80G/IDE
[Èí¼þÅäÖÃ]
OS : Windows XP SP2
SE : PHP5.2.1
DB : MySQL5.0.37
Web: IIS6
[MySQL±í½á¹¹]
CREATE TABLE `myisam` (
  `id` int(11) NOT NULL auto_increment,
  `name` varchar(100) default NULL,
  `content` text,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=gbk;
CREATE TABLE `innodb` (
  `id` int(11) NOT NULL auto_increment,
  `name` varchar(100) default NULL,
  `content` text,
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=gbk;
[Êý¾ÝÄÚÈÝ]
$name = "heiyeluren";
$content = "MySQLÖ§³ÖÊý¸ö´æ´¢ÒýÇæ×÷Ϊ¶Ô²»Í¬±íµÄÀàÐ͵Ĵ¦ÀíÆ÷¡£MySQL´æ´¢ÒýÇæ°üÀ¨´¦ÀíÊÂÎñ°²È«±íµÄÒýÇæºÍ´¦Àí·ÇÊÂÎñ°²È«±íµÄÒýÇ棺· MyISAM¹ÜÀí·ÇÊÂÎñ±í¡£ËüÌṩ¸ßËÙ´æ´¢ºÍ¼ìË÷£¬ÒÔ¼°È«ÎÄËÑË÷ÄÜÁ¦¡£MyISAMÔÚËùÓÐMySQLÅäÖÃÀï±»Ö§³Ö£¬ËüÊÇĬÈϵĴ洢ÒýÇ棬³ý·ÇÄãÅäÖÃMySQLĬÈÏʹÓÃÁíÍâÒ»¸öÒýÇæ¡£ ·MEMORY´æ´¢ÒýÇæÌṩ“ÄÚ´æÖД±í¡£MERGE´æ´¢ÒýÇæÔÊÐí¼¯ºÏ½«±»´¦ÀíͬÑùµÄMyISAM±í×÷Ϊһ¸öµ¥¶ÀµÄ±í¡£¾ÍÏñMyISAMÒ»Ñù£¬MEMORYºÍMERGE´æ´¢ÒýÇæ´¦Àí·ÇÊÂÎñ±í£¬ÕâÁ½¸öÒýÇæÒ²¶¼±»Ä¬ÈÏ°üº¬ÔÚMySQLÖС£ ÊÍ£ºMEMORY´æ´¢ÒýÇæÕýʽµØ±»È·¶¨ÎªHEAPÒýÇæ¡£· InnoDBºÍBDB´æ´¢ÒýÇæÌṩÊÂÎñ°²È«±í¡£BDB±»°üº¬ÔÚΪ֧³ÖËüµÄ²Ù×÷ϵͳ·¢²¼µÄMySQL-Max¶þ½øÖÆ·Ö·¢°æÀï¡£InnoDBҲĬÈϱ»°üÀ¨ÔÚËùÓÐMySQL 5.1¶þ½øÖÆ·Ö·¢°æÀÄã¿ÉÒÔ°´ÕÕϲºÃͨ¹ýÅäÖÃMySQLÀ´ÔÊÐí»ò½ûÖ¹ÈÎÒ»ÒýÇæ¡£·EXAMPLE´æ´¢ÒýÇæÊÇÒ»¸ö“´æ¸ù”ÒýÇ棬Ëü²»×öʲô¡£Äã¿ÉÒÔÓÃÕâ¸öÒýÇæ´´½¨±í£¬µ«Ã»ÓÐÊý¾Ý±»´æ´¢ÓÚÆäÖлò´ÓÆäÖмìË÷¡£Õâ¸öÒýÇæµÄÄ¿µÄÊÇ·þÎñ£¬ÔÚMySQLÔ´´úÂëÖеÄÒ»¸öÀý×Ó£¬ËüÑÝʾ˵Ã÷ÈçºÎ¿ªÊ¼±àдд洢ÒýÇ档ͬÑù£¬ËüµÄÖ÷ÒªÐËȤÊǶԿª·¢Õß¡£";
[²åÈëÊý¾Ý-1] (innodb_flush_log_at_trx_commit=1)
MyISAM 1W£º3/s
InnoDB 1W£º219/s
MyISAM 10W£º29/s
InnoDB 10W£º2092/s
MyISAM 100W£º287/s
InnoDB 100W£ºÃ»¸Ò²âÊÔ
[²åÈëÊý¾Ý-2] (innodb_flush_log_at_trx_commit=0)
MyISAM 1W£º3/s
InnoDB 1W£º3/s
MyISAM 10W£º30/s
InnoDB 10W£º29/s
MyISAM 100W£º273/s
InnoDB 100W£º423/s
[²åÈëÊý¾Ý3] (innodb_buffer_pool_size=1024M)
InnoDB 1W£º3/s
InnoDB 10W£º33/s
InnoDB 100W£º607/s
[²åÈ


Ïà¹ØÎĵµ£º

MySQL×Ö·û¼¯µÄÉèÖÃ

¡¾Ç°Ìá¡¿
winxpsp3
mysql5.1
¡¾²½Öè¡¿
1.½øÈëMySQL Command Line Client;
2.ÃüÁ
mysql> show variables like 'character%';
+--------------------------+---------------------------------------------------------+
| Variable_name            | ......

mysqlÃÜÂëÍü¼ÇµÄÐ޸ķ½·¨

1¡¢ÔÚlinuxÏ£º
     ²é¿´mysql ÊÇ·ñÔËÐУºps -ef | grep myslq
     Èç¹û MySQL ÕýÔÚÔËÐУ¬Ê×ÏÈɱ֮: kill mysqlµÄ½ø³ÌºÅ¡£
¡¡¡¡Æô¶¯ MySQL :/usr/bin/safe_mysqld --skip-grant-tables &
¡¡¡¡¾Í¿ÉÒÔ²»ÐèÒªÃÜÂë¾Í½øÈë MySQL ÁË¡£
¡¡¡¡È»ºó¾ÍÊÇ
¡¡¡¡>use mysql
¡¡¡¡ ......

MysqlÖÐÈçºÎÅúÁ¿Éú³É½Å±¾


[root@sql21 ~]# mysql -u root
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3 to server version: 5.1.26-rc-log
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> show databases;
+--------------------+
| Database  &nb ......

mysql×Ö·û¼¯²é¿´ÒÔ¼°ÐÞ¸Ä

ת×Ô:http://blog.chinaunix.net/u2/85344/showart_2042280.html
LiunxÏÂÐÞ¸ÄMySQL×Ö·û¼¯£º
1.²éÕÒMySQLµÄcnfÎļþµÄλÖÃ
find / -iname '*.cnf' -print

/usr/share/mysql/my-innodb-heavy-4G.cnf
/usr/share/mysql/my-large.cnf
/usr/share/mysql/my-small.cnf
/usr/share/mysql/my-medium.cnf
/usr/share/mysql ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ