mysql һЩ¼òµ¥²Ù×÷
Rubicon
Á˽âÁËһЩ×î»ù±¾µÄ²Ù×÷ÃüÁîºó£¬ÎÒÃÇÔÙÀ´Ñ§Ï°ÈçºÎ´´½¨Ò»¸öÊý¾Ý¿âºÍÊý¾Ý¿â±í¡£
¡¡¡¡1¡¢Ê¹ÓÃSHOWÓï¾äÕÒ³öÔÚ·þÎñÆ÷Éϵ±Ç°´æÔÚʲôÊý¾Ý¿â£º
mysql> SHOW DATABASES; +----------+
| Database | +----------+ | mysql |
| test | +----------+ 3 rows in set (0.00 sec)
¡¡¡¡2¡¢´´½¨Ò»¸öÊý¾Ý¿âabccs
¡¡¡¡mysql> CREATE DATABASE abccs;
¡¡¡¡×¢Òⲻͬ²Ù×÷ϵͳ¶Ô´óСдµÄÃô¸Ð¡£
¡¡¡¡3¡¢Ñ¡ÔñÄãËù´´½¨µÄÊý¾Ý¿â
¡¡¡¡mysql> USE abccs
¡¡¡¡Database changed
¡¡¡¡´ËʱÄãÒѾ½øÈëÄã¸Õ²ÅËù½¨Á¢µÄÊý¾Ý¿âabccs.
¡¡¡¡4¡¢ ´´½¨Ò»¸öÊý¾Ý¿â±í
¡¡¡¡Ê×ÏÈ¿´ÏÖÔÚÄãµÄÊý¾Ý¿âÖдæÔÚʲô±í£º
¡¡¡¡mysql> SHOW TABLES;
¡¡¡¡Empty set (0.00 sec)
¡¡¡¡ËµÃ÷¸Õ²Å½¨Á¢µÄÊý¾Ý¿âÖл¹Ã»ÓÐÊý¾Ý¿â±í¡£ÏÂÃæÀ´´´½¨Ò»¸öÊý¾Ý¿â±ímytable:
¡¡¡¡ÎÒÃÇÒª½¨Á¢Ò»¸öÄ㹫˾Ա¹¤µÄÉúÈÕ±í£¬±íµÄÄÚÈÝ°üº¬Ô±¹¤ÐÕÃû¡¢ÐԱ𡢳öÉúÈÕÆÚ¡¢³öÉú³ÇÊС£
mysql> CREATE TABLE mytable (name VARCHAR(20), sex CHAR(1),
-> birth DATE, birthaddr VARCHAR(20));
Query OK, 0 rows affected (0.00 sec)
¡¡¡¡ÓÉÓÚname¡¢birthaddµÄÁÐÖµÊDZ仯µÄ£¬Òò´ËÑ¡ÔñVARCHAR£¬Æ䳤¶È²»Ò»¶¨ÊÇ20¡£¿ÉÒÔÑ¡Ôñ´Ó1µ½255µÄÈκγ¤¶È£¬Èç¹ûÒÔºóÐèÒª¸Ä±äËüµÄ×Ö³¤£¬¿ÉÒÔʹÓÃALTER TABLEÓï¾ä¡££©;ÐÔ±ðÖ»ÐèÒ»¸ö×Ö·û¾Í¿ÉÒÔ±íʾ£º"m"»ò"f"£¬Òò´ËÑ¡ÓÃCHAR(1);birthÁÐÔòʹÓÃDATEÊý¾ÝÀàÐÍ¡£
¡¡¡¡´´½¨ÁËÒ»¸ö±íºó£¬ÎÒÃÇ¿ÉÒÔ¿´¿´¸Õ²Å×öµÄ½á¹û£¬ÓÃSHOW TABLESÏÔʾÊý¾Ý¿âÖÐÓÐÄÄЩ±í£º
mysql> SHOW TABLES; +---------------------+
| Tables in menagerie | +---------------------+ | mytables
| +---------------------+
¡¡¡¡5¡¢ÏÔʾ±íµÄ½á¹¹£º
mysql> DESCRIBE mytable;
+-------------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------------+-------------+------+-----+---------+-------+
| name | varchar(20) | YES | | NULL | | | sex | char(1)
| YES | | NULL | | | birth | date | YES | | NULL | |
| deathaddr | varchar(20) | YES | | NULL |
| +-------------+-------------+------+-----+---------+-------+
4 rows in set (0.00 sec)
¡¡¡¡6¡¢ Íù±íÖмÓÈë¼Ç¼
¡¡¡¡ÎÒÃÇÏÈÓÃSELECTÃüÁîÀ´²é¿´±íÖеÄÊý¾Ý£º
¡¡¡¡mysql> select * from mytable;
¡¡¡¡Empty set (0.00 sec)
¡¡¡
Ïà¹ØÎĵµ£º
mysql event (ÓÃÀ´ÊµÏÖ¶¨Ê±ÈÎÎñ)¡£mysql
´Ó
5.1.16
¿ªÊ¼ÓµÓеÄй¦ÄÜ¡£
ÏÂÃæÎÒдһ¸ö¼òµ¥µÄʾÀý¡£
ÏÈ´´½¨Êý¾Ý¿âºÍÁ½¸ö±í£º
drop database dep;
create database dep;
use dep;
create table aa
(id int AUTO_INCREMENT primary key,
remark varchar(20)
);
create table bb
(id int AUTO_INCREMENT primary k ......
À´Ô´: ChinaUnix²©¿Í ¡¡ÈÕÆÚ£º 2008.04.28 12:29¡¡(¹²ÓÐ0ÌõÆÀÂÛ) ÎÒÒªÆÀÂÛ
ÊÇÓÃmysqlµÄʱºò£¬×Ö·û±àÂëÊǸö´óÎÊÌ⣬ÎÒһֱʹÓÃutf8µÄ±àÂ룬»ù±¾ÉÏûʲô´óÎÊÌ⣬¾ÍÊÇÿ´ÎÆô¶¯mysqlµÄʱºò¶¼ÐèÒªÉèÖÃһϣ¬mysql£¬Ê±¼ä³¤ÁË£¬Ò²¹ÖÂé·³µÄ£¬ÔÚÍøÉÏËÑÁËһϣ¬·¢ÏÖÏÂÃæµÄ·½·¨ÄÜÍêÈ«½â¾öÕâ¸öÎÊÌ⣬µ±È»Èç¹ûÊÇ×Ô¼º±àÒëµÄmy ......
create procedure all_joiner_message( in captions varchar(255), in contents text, in objectid int, in types int , out count int)
begin
declare userids int;
DECLARE _done IN ......
ÔÚÌÚ¿ÆÅàѵÁËÓÐ1¸ö°ëÔÂÁË£¬ÖÕÓÚѧÍêJSP+SERVLET+JAVABEAN+MYSQL£¬Ñ§ÁËjavaµÄµÚÒ»Ì×web½â¾ö·½°¸¡£ÀÏʦҪÇóÎÒÃÇ6ÈËÒ»×鿪ʼ×öÒ»¸ö¶©²Íϵͳ¡£Õâ¸öϵͳûÓÐʲôÌرðµÄ£¬¾Í¸úµç×ÓÉ̳ÇÊÇÒ»¸öÑùµÄ¡£ÓÉÓÚÒª¶ÔÊý¾Ý¿â×ö´óÁ¿µÄÔöɾ¸Ä²é£¬ÄǸö´úÂëÓֶ࣬ÎÒÏëÄܲ»Äܽ«Êý¾Ý¿â²Ù×÷µÄÕâÒ»²ã´ò°üÆðÀ´(SqlOperDao)£¬ÈÃÎÒ¶ÔÊý¾Ý¿â²Ù×÷£¬Óü¸Ðд ......
ÔÚ±¾ÎÄÖУ¬ÎÒÃǽ«Ñ§Ï°ÈçºÎͨ¹ýPHP 5µÄÒ»¸ö»ù±¾³éÏóÀàʹÓÃÍâ¼üÔ¼ÊøÀ´¸üÐÂÁ½¸öInnoDB±íµÄÊý¾Ý¡£ ÎÒÃǽ«Í¨¹ý¾ßÌåʾÀýÀ´ËµÃ÷ÈçºÎͨ¹ý·þÎñÆ÷¶Ë½Å±¾ÓïÑÔÀ´Ê¹ÓÃÍâ¼üÔ¼Êø¡£
¡¡¡¡Ò»¡¢ÀûÓÃÍâ¼üÔ¼Êø¸üÐÂMySQLÖеÄÊý¾Ý
¡¡¡¡ÏÖÔÚ£¬×îÁ÷ÐеĿªÔ´¹ØϵÐÍÊý¾Ý¿â¹ÜÀíϵͳ·ÇMySQLĪÊô£¬¶øMySQLÓÖÖ§³Ö¶à¸ö´æ´¢ÒýÇ棬ÆäÖÐĬÈϵÄÒ²ÊÇËٶȽϿìµÄ´ ......