MySQL´æ´¢ÒýÇæ Ó¦ÓÃ
MySQL·þÎñÆ÷²ÉÓÃÁËÄ£¿é»¯·ç¸ñ£¬¸÷²¿·ÖÖ®¼ä±£³ÖÏà¶Ô¶ÀÁ¢£¬ÓÈÆäÌåÏÖÔÚ´æ´¢¼Ü¹¹ÉÏ¡£´æ´¢ÒýÇ渺Ôð
¹ÜÀíÊý¾Ý´æ´¢£¬ÒÔ¼°MySQLµÄË÷Òý¹ÜÀí¡£Í¨¹ý¶¨ÒåµÄAPI£¬MySQL·þÎñÆ÷Äܹ»Óë´æ´¢ÒýÇæ½øÐÐͨÐÅ¡£Ä¿Ç°Ê¹ÓÃ×î¶àµÄÊÇMyISAMºÍInnoDB¡£
InnoDB±»OracleÊÕ¹ººó£¬MySQL×ÔÐпª·¢µÄд洢ÒýÇæFalcon½«ÔÚMySQL6.0°æ±¾Òý½ø¡£
MyISAMÒýÇæÊÇÒ»ÖÖ·ÇÊÂÎñÐÔµÄÒýÇ棬Ìṩ¸ßËÙ´æ´¢ºÍ¼ìË÷£¬ÒÔ¼°È«ÎÄËÑË÷ÄÜÁ¦£¬ÊʺÏÊý¾Ý²Ö¿âµÈ²éѯƵ·±µÄÓ¦Óá£MyISAMÖУ¬Ò»¸ötableʵ¼Ê±£´æΪÈý¸öÎļþ£¬.frm´æ´¢±í¶¨Ò壬.MYD´æ´¢Êý¾Ý,.MYI´æ´¢Ë÷Òý¡£
InnoDB
ÔòÊÇÒ»ÖÖÖ§³ÖÊÂÎñµÄÒýÇæ¡£ËùÒÔµÄÊý¾Ý´æ´¢ÔÚÒ»¸ö»òÕ߶à¸öÊý¾ÝÎļþÖУ¬Ö§³ÖÀàËÆÓÚOracleµÄËø»úÖÆ¡£Ò»°ãÔÚOLTPÓ¦ÓÃÖÐʹÓýϹ㷺¡£Èç¹ûûÓÐÖ¸¶¨
InnoDBÅäÖÃÑ¡ÏMySQL½«ÔÚMySQLÊý¾ÝĿ¼Ï´´½¨Ò»¸öÃûΪibdata1µÄ×Ô¶¯À©Õ¹Êý¾ÝÎļþ£¬ÒÔ¼°Á½¸öÃûΪib_logfile0ºÍ
ib_logfile1µÄÈÕÖ¾Îļþ¡£
´´½¨tableʱ¿ÉÒÔͨ¹ýengine¹Ø¼ü×ÖÖ¸¶¨Ê¹ÓõĴ洢ÒýÇ棬Èç¹ûÊ¡ÂÔÔòʹÓÃϵͳĬÈϵĴ洢ÒýÇ棺
CREATE TABLE t (i INT) ENGINE = MYISAM;
²é¿´ÏµÍ³ÖÐÖ§³ÖµÄ´æ´¢ÒýÇæÀàÐÍ£º
mysql> show engines;
+------------+---------+----------------------------------------------------------------+
| Engine | Support | Comment |
+------------+---------+----------------------------------------------------------------+
| MyISAM | YES | Default engine as of MySQL 3.23 with great performance |
| MEMORY | YES | Hash based, stored in memory, useful for temporary tables |
| InnoDB | DEFAULT | Supports transactions, row-level locking, and foreign keys |
| BerkeleyDB | NO | Supports transactions and page-level locking |
| BLACKHOLE | NO | /dev/null storage engine (anything you wr
Ïà¹ØÎĵµ£º
¹ØÓÚMySQLÊÂÎñ´¦Àíѧϰ¼Ç
START TRANSACTION, COMMITºÍROLLBACKÓï·¨
START TRANSACTION | BEGIN [WORK]
COMMIT [WORK] [AND [NO] CHAIN] [[NO] RELEASE]
ROLLBACK [WORK] [AND [NO] CHAIN] [[NO] RELEASE]
SET AUTOCOMMIT = {0 | 1}
START
TRANSACTION»òBEGINÓï¾ä¿ÉÒÔ¿ªÊ¼Ò»ÏîеÄÊÂÎñ¡£COMMIT¿ÉÒÔÌá½»µ±Ç°ÊÂÎñ ......
netbeans6.7ÖÐÏòmysql5ÖвåÈëÖÐÎÄÊý¾ÝʱÏÔʾ”data too long for column“µÄÎÊÌâ¡£
ÎÒµÄmysqlÖÐ×Ö·ûµÄÉèÖÃʱutf-8£¬²¢ÇÒÔÚ¿ØÖÆ̨ÖпÉÒÔ²åÈëÖÐÎÄÊý¾Ý²¢ÏÔʾ£¬µ«ÔÚnetbeansÖвåÈëÊý¾Ýʱȴ×ÜÊÇÏÔʾ”data too long for column“¡£»ù±¾¿ÉÒÔÅжÏÊÇÓÉÓÚnetbeansºÍmysqlÖ®¼äµÄÊý¾Ý½»»»³öÁ ......
1¡£ ¸Ä±í·¨¡£¿ÉÄÜÊÇÄãµÄÕʺŲ»ÔÊÐí´ÓÔ¶³ÌµÇ½£¬Ö»ÄÜÔÚlocalhost¡£Õâ¸öʱºòÖ»ÒªÔÚlocalhostµÄÄÇ̨µçÄÔ£¬µÇÈëmysqlºó£¬¸ü¸Ä "mysql" Êý¾Ý¿âÀïµÄ "user" ±íÀïµÄ "host" Ï´Ó"localhost"¸Ä³Æ"%"
mysql -u root -p
mysql>use mysql;
mysql>update user set& ......