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

mysql ³£ÓþÙÀý

drop table student;
create table student
(sno   int   not null unique,
 sname varchar(8) not null,
 ssex  char(2)    not null,
 sage int ,
 sdept varchar(20));
 
 select * from student;
 alter table student drop unique(sno);
 alter table student modify sno primary key;
 alter table student add constraints con_s check(ssex in('F', 'M'));
 
 insert into  student values ('0001', 'zhangwen', 'F', 24, 'math');
 insert into  student values ('0201', 'zhangzi', 'F', 24, 'jsj');
 insert into  student values ('0002', 'wangjing', 'M', 22, 'math');
 insert into  student values ('0301', 'lilu', 'M', 23, 'wuli');
 insert into  student values ('0003', 'wujun', 'M', 24, 'math');
 insert into  student values ('0202', 'wangli', 'F', 23, 'jsj');
 insert into  student values ('0203', 'jiangmin', 'M', 23, 'jsj');
 insert into  student values ('0302', 'lixiang', 'F', 23, 'wuli');
 insert into  student values ('0303', 'jinmin', 'F', 24, 'wuli');
 insert into  student values ('0304', 'jinmin', 'F', null, 'wuli');
 insert into  student values ('0204', 'jinmin', 'F', 22, '');
 delete from student where sno = '0204';
 update student set sname = 'luyong' where sno = '0304';
 insert into student values('0004','meinv','M',22,'math');
 insert into student values('0006','beauty','M',21,'math');
 ----------------------------------------------
 drop table course;
 create table course(cno int primary key,
                     cname varchar2(10) not null,
                     ccredite float(2));
        


Ïà¹ØÎĵµ£º

UbuntuϳöÏÖMysql error(2002)µÄ½â¾ö·½·¨

      ¹ýÁËÒ»Õó×Óºó£¬ÎªÁËд·Ö²¼Ê½×÷Òµ£¬ÖØÐÂʹÓÃMysqlʱ£¬·¢ÏÖËäÈ»Æô¶¯³É¹¦ÁË£¬µ«ÊÇÁ¬½ÓµÄʱºòÈ¥³öÏÖÈçÏ´íÎó
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
¸ù¾ÝÌáʾÊÇ/var/run/mysqld/mysqld.sockÎļþ²»´æÔÚ¡£
Ϊʲô»áÕâÑùÄØ£¿
  ......

¹ØÓÚmysqlµÄ¾Û¼¯Ë÷Òý

·­Ò룺
InnoDB±í»á°üº¬Ò»¸ö¾Û¼¯Ë÷Òý£¨Êý¾Ý±íµÄÎïÀí´æ´¢Ë³ÐòºÍ±íµÄÂß¼­´æ´¢Ë³ÐòÒ»Ö£©
Ò»°ãÊÇ°´ÕÕÏÂÃæµÄ¹æÔòÀ´É趨¾Û¼¯Ë÷ÒýµÄ£º
1£¬¼ÙÈç±í°üº¬PRIMARY KEY£¬InnoDBʹÓÃËü×÷Ϊ¾Û¼¯Ë÷Òý
2£¬¼ÙÈç±íûÓж¨ÒåPRIMARY KEY£¬InnoDB½«µÚÒ»¸öÖ»°üº¬NOT NULLÊôÐÔÁеÄUNIQUE index×÷ΪÖ÷¼ü²¢ÇÒ½«ËüÉèÖÃΪ¾Û¼¯Ë÷Òý
3£¬Ç°Á½Õ߶¼²»Âú× ......

MySQLÊý¾Ý¿â±¸·ÝÓë»Ö¸´

·½·¨Ò»£º
1.µ¼³öÕû¸öÊý¾Ý¿â
ÃüÁîÐнøÈëµ½mysql°²×°Ä¿Â¼µÄbinĿ¼ÏÂ
¼ÙÉè×°ÔÚD:/mysql/bin
¼´£º¿ªÊ¼ ÔËÐÐ ÊäÈëcmd
d:
cd mysql/bin
È»ºóÖ´ÐÐÏÂÃæÓï¾ä
mysqldump -u Óû§Ãû -p Êý¾Ý¿âÃû > µ¼³öµÄÎļþÃû  
ʾÀý£ºmysqldump -u root -p sq_wcnc > d:\wcnc.sql
2.»Ö¸´Êý¾Ý¿â
   ³£ÓÃsource ÃüÁî ......

MySQL°²裝Ö¸ÄÏ

Òª°²裝 MySQL£¬¿ÉÒÔÔÚ終¶ËÌáʾ·ûºó運ÐÐÏÂÁÐÃüÁ
sudo apt-get install mysql-server
sudo apt-get install mysql-client
sudo apt-get install php5-mysql
// °²×°php5-mysql Êǽ«phpºÍmysqlÁ¬½ÓÆðÀ´
Ò»µ©°²裝Íê³É£¬MySQL ·þ務Æ÷應該×Ô動啟動¡£Äú¿ÉÒÔ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ