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

MYSQL½¨¿â½¨±í¼üÔ¼Êø


drop database if exists StudentDB;
create database StudentDB;
use StudentDB; 
create table StudentInfo 

StuName varchar(8) not null, 
StuNo char(6) not null primary key,
StuSex char(2) not null default 'ÄÐ', 
StuAge tinyint not null, 
StuSeat tinyint not null,
StuAddress varchar(50) not null default 'µØÖ·²»Ïê',
-- constraint PK_StudentInfo_StuSeat primary key (StuNo),
constraint CK_StudentInfo_StuSex check(StuSex in('ÄÐ','Å®')),
constraint CK_StudentInfo_StuNo check(StuNo like 's253[0-9][0-9]'),
constraint CK_StudentInfo_StuAge check(StuAge < 40 and StuAge > 15)
-- constraint CK_StudentInfo_StuSeat check(StuSeat < 30 and StuSeat > 0)
-- constraint DF_StudentInfo_StuAddress default 'µØÖ·²»Ïê'
);
insert into StudentInfo values('ÕÅÇïÀö','s25301','´ó',18,1,'±±¾©º£µí'),
('Àî˹ÎÄ','s25303','ÄÐ',22,2,'±±¾©º£µí'),
('ÀîÎIJÅ','s25302','ÄÐ',85,3,'µØÖ·²»Ïê'),
('Å·Ñô¿¡ÐÛ','s25304','ÄÐ',28,4,'н®'),
('÷³¬·ç','s25318','Å®',23,5,'');
use StudentDB;
create table StudentMarks
(
ExamNo char(7) not null primary key,
StuNo char(6) not null,
WrittenExam tinyint not null,
LabExam tinyint not null,
-- constraint PK_StudentMarks_ExamNo primary key StuNo,
constraint FK_StudentInfo_StudentMarks_StuNo foreign key (StuNo) references StudentInfo(StuNo)
);
insert into StudentMarks values('s271811','s25303',90,58),('s271813','s25302',60,90),('s271816','s25301',87,82);


Ïà¹ØÎĵµ£º

¹ØÓÚmysql¶ÁÈ¡¡¢Ð´Èë³öÏÖÂÒÂëµÄ½â¾ö·½·¨£¨¸öÈË×ܽᣩ

ÎÒʹÓõÄÊÇapserv°²×°°ü£¬°²×°Ê±ÓïÑÔÎÒÑ¡ÔñµÄÊÇgb2312£¬ºóÀ´ÔÚ½¨Á¢ÐµÄÊý¾Ý¿âʱ£¬‘ÕûÀí’Ñ¡ÔñµÄÊÇutf8£¬½ÓÏÂÀ´ÔÚ±íÖвÎÊýÀàÐÍ»ù±¾Ñ¡ÔñµÄ¶¼ÊÇutf8£¬½ÓÏÂÀ´ÎÒ¾ÍÖ±½Óµ÷ÓÃÀ²£¬¸Â¸Â£¬ÎÒдµÄÊÇÒ»¸ö¼òµ¥µÄÁôÑÔ±¾¡£×î¼òµ¥µÄ¶ÁÈ¡Êý¾Ý¿âдÈëÊý¾Ý¿âµÄ³ÌÐò£¬¸Â¸Â£¡Ææ¹ÖµÄÊÇÔÚÊý¾Ý¿âÀïÃæÖ±½Ó²Ù×÷ÖÐÎÄÏÔʾ¶¼ºÜÕý³£¡£¿ÉÊÇÒ»µ½Íø ......

ubuntu ÏÂ MYSQL °²×°

°²×°MySQL
sudo apt-get install mysql-server mysql-admin mysql-navigator mysql-query-browser
Õâ¸öÓ¦¸ÃºÜ¼òµ¥ÁË£¬¶øÇÒÎÒ¾õµÃ´ó¼ÒÔÚ°²×°·½ÃæÒ²Ã»Ê²Ã´Ì«´óÎÊÌ⣬ËùÒÔÒ²¾Í²»¶à˵ÁË£¬ÏÂÃæÎÒÃÇÀ´½²½²ÅäÖá£
ÅäÖÃMySQL
×¢Ò⣬ÔÚUbuntuÏÂMySQLȱʡÊÇÖ»ÔÊÐí±¾µØ·ÃÎʵģ¬Èç¹ûÄãÒªÆäËû»úÆ÷Ò²Äܹ»·ÃÎʵϰ£¬ÄÇôÐèÒª¸Ä±ä/etc/m ......

MySQL Storage Engine

http://www.javaeye.com/topic/211951
Õâ¶Îʱ¼äÔÚ¿´¡¶High Performance MySQL¡·£¬¿´µ½´æ´¢ÒýÇæÕâ¸öµØ·½¸Ðµ½ºÜ¶àϸ½Ú±È½ÏİÉú£¬ËùÒÔ×ܽáС¼ÇһЩ
ΪÁËÊÊÓ¦¸÷ÖÖ²»Í¬µÄÔËÐл·¾³£¬MYSQLÌṩÁ˶àÖÖ²»Í¬µÄ´æ´¢ÒýÇæ£¨Storage Engine £©,ÔÚÓ¦ÓóÌÐò¿ª·¢Õâ¸ö²ãÃæÉÏ£¬¿ª·¢Õß¿ÉÒÔ¸ù¾Ý²»Í¬µÄÐèÇóÑ¡ÔñÊʺϵÄStorage Engine ·½°¸£¬¸üΪÁ ......

MYSQL Íâ¼ü¶¨ÒåÓëʹÓÃ

 
ÔÚMySQL 3.23.44°æ±¾ºó£¬InnoDBÒýÇæÀàÐ͵ıíÖ§³ÖÁËÍâ¼üÔ¼Êø¡£
Íâ¼üµÄʹÓÃÌõ¼þ£º
1.Á½¸ö±í±ØÐëÊÇInnoDB±í£¬MyISAM±íÔÝʱ²»Ö§³ÖÍâ¼ü£¨¾Ý˵ÒÔºóµÄ°æ±¾ÓпÉÄÜÖ§³Ö£¬µ«ÖÁÉÙĿǰ²»Ö§³Ö£©£»
2.Íâ¼üÁбØÐ뽨Á¢ÁËË÷Òý£¬MySQL 4.1.2ÒÔºóµÄ°æ±¾ÔÚ½¨Á¢Íâ¼üʱ»á×Ô¶¯´´½¨Ë÷Òý£¬µ«Èç¹ûÔÚ½ÏÔçµÄ°æ±¾ÔòÐèÒªÏÔʾ½¨Á¢£»
3.Íâ¼ü¹ØÏ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ