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

mysqlµÄÓ÷¨

 Ò»¡¢»ù´¡
1¡¢ËµÃ÷£º´´½¨Êý¾Ý¿â
Create DATABASE database-name
2¡¢ËµÃ÷£ºÉ¾³ýÊý¾Ý¿â
drop database dbname
3¡¢ËµÃ÷£º±¸·Ýsql server
--- ´´½¨ ±¸·ÝÊý¾ÝµÄ device
USE master
EXEC sp_addumpdevice 'disk', 'testBack', 'c:\mssql7backup\MyNwind_1.dat'
--- ¿ªÊ¼ ±¸·Ý
BACKUP DATABASE pubs TO testBack
4¡¢ËµÃ÷£º´´½¨Ð±í
create table tabname(col1 type1 [not null] [primary key],col2 type2 [not null],..)
¸ù¾ÝÒÑÓÐµÄ±í´´½¨ÐÂ±í£º
A£ºcreate table tab_new like tab_old (ʹÓÃ¾É±í´´½¨Ð±í)
B£ºcreate table tab_new as select col1,col2… from tab_old definition only
C: auto_increment ´´½¨×Ô¶¯Ôö³¤ÁР µÚÒ»ÁбØÐë×Ô¼º¶¨ÒåÔö³¤Á¿
5¡¢ËµÃ÷£ºÉ¾³ýбí
drop table tabname
6¡¢ËµÃ÷£ºÔö¼ÓÒ»¸öÁÐ
Alter table tabname add column col type
×¢£ºÁÐÔö¼Óºó½«²»ÄÜɾ³ý¡£DB2ÖÐÁмÓÉϺóÊý¾ÝÀàÐÍÒ²²»Äܸı䣬ΨһÄܸıäµÄÊÇÔö¼ÓvarcharÀàÐ͵ij¤¶È¡£
7¡¢ËµÃ÷£ºÌí¼ÓÖ÷¼ü£º Alter table tabname add primary key(col)
˵Ã÷£ºÉ¾³ýÖ÷¼ü£º Alter table tabname drop primary key(col)
˵Ã÷:×Ô¶¯Ôö³¤: ÁÐ ÁÐÀàÐÍ auto_increment,È»ºó²åÈëÊý¾ÝµÄʱºòÉèÖõÚÒ»ÌõΪxxxxx,ºóÃæµÄ¾Í²»ÓÃÉèÖÃ,Ö±½ÓΪxxxxx+1;
8¡¢ËµÃ÷£º´´½¨Ë÷Òý£ºcreate [unique] index idxname on tabname(col….)
ɾ³ýË÷Òý£ºdrop index idxname
×¢£ºË÷ÒýÊDz»¿É¸ü¸ÄµÄ£¬Ïë¸ü¸Ä±ØÐëɾ³ýÖØн¨¡£
9¡¢ËµÃ÷£º´´½¨ÊÓͼ£ºcreate view viewname as select statement
ɾ³ýÊÓͼ£ºdrop view viewname
10¡¢ËµÃ÷£º¼¸¸ö¼òµ¥µÄ»ù±¾µÄsqlÓï¾ä
Ñ¡Ôñ£ºselect * from table1 where ·¶Î§
²åÈ룺insert into table1(field1,field2) values(value1,value2)
ɾ³ý£ºdelete from table1 where ·¶Î§
¸üУºupdate table1 set field1=value1 where ·¶Î§
²éÕÒ£ºselect * from table1 where field1 like ’%value1%’ ---likeµÄÓï·¨ºÜ¾«Ã²é×ÊÁÏ!
ÅÅÐò£ºselect * from table1 order by field1,field2 [desc]
×ÜÊý£ºselect count as totalcount from table1
ÇóºÍ£ºselect sum(field1) as sumvalue from table1
ƽ¾ù£ºselect avg(field1) as avgvalue from table1
×î´ó£ºselect max(field1) as maxvalue from table1
×îС£ºselect min(field1) as minvalue from table1
11¡¢ËµÃ÷£º¼¸¸ö¸ß¼¶²éѯÔËËã´Ê
A£º UNION ÔËËã·û
UNION ÔËËã·ûͨ¹ý×éºÏÆäËûÁ½


Ïà¹ØÎĵµ£º

mysql±¸·ÝÊý¾Ý¿âÒÔ¼°¿½±´Êý¾Ý¿âµ½Áíһ̨·þÎñÆ÷ÉÏ

 ÏîÄ¿Òª½áÊøÁË...ÖÁÉÙ¿ª·¢Òª½áÊøÁË...
»ØÍ·¿´¿´×Ô¼º¾ÍÕâôһ¸öÈËÂñÍ·¿ª·¢ÁË4¸öÔ£¬ÒÔ¼°ÊÖÉÏÄõ½µÄÓë×Ô¼º¸¶³öÍêÈ«²»³ÉÕý±ÈµÄ΢±¡¹¤×Ê£¬¾õµÃ×Ô¼ºÕætmdµÄ±¯¾ç£¡
»òÐíÕâ¾ÍÊÇÓ¦½ì±ÏÒµÉúµÄÃü°É...¶÷£¬ÏÖÔÚÎÒÒѾ­²»ÊÇÓ¦½ì±ÏÒµÉúÁË...
ÏÖÔÚÏîÄ¿×öÍêÁË£¬ÎÒÒ²¾¡µ½ÁËÉÆʼÉÆÖÕµÄÒåÎñÁË...
¿àË®¾Íµ¹µ½ÕâÀ»¹ÊǻعéÕýÌâ¡£
ÓÉÓ ......

Using JDBC with MySQL, Getting Started

http://www.developer.com/java/data/article.php/3417381/Using-JDBC-with-MySQL-Getting-Started.htm#Preface
Preface
Purpose
The purpose of this lesson is to get you beyond the initial hurdles involved in:
Downloading and installing a MySQL database server.
Preparing that database for use with JDBC ......

mysqlÖÐÌí¼ÓÍâ¼üÔ¼Êø

 ¾­³£Óõ½£¬µ«ÊÇ×ÜÊǼDz»×¡¡£
Óï·¨ÈçÏ£º
ALTER TABLE JOB ADD CONSTRAINT fk_prono
FOREIGN KEY(PRONO)
REFERENCES PROJECT(PRONO)
ON DELETE CASCADE
ON UPDATE NO ACTION;
ÎÒÔÚmysqlÖÐÌí¼ÓÁËÍâ¼üÔ¼Êø£¬ÊÔÁË°ëÌìû³É¹¦£¬ºóÀ´°ÑÍâ¼üµÄÃû×ÖÓÉFK¸Ä³ÉFK_1¾ÍºÃÁË£¬¿ÉÄÜmysqlÖÐFKÊǸö±£Áô×Ö£¬×¢Ò⣡ ......

¹ØÓÚMySQLµÄ1067´íÎó½â¾ö·½·¨

 
ÄÚÈÝ£º
*************
1
°²×°£Í£Ù£Ó£Ñ£Ìºó¸ü¸ÄÁˣңϣϣԵÄÃÜÂëºóÓÃ
net startmysql
Æô¶¯Ê±ÎÒ¾ÍÓöµ½ÁËÕâÑùµÄÎÊÌ⣮ʹÓÃÒÔÏÂÃüÁîºó
c:\mysql\bin\mysqladmin-u root -p shutdown
ÔÙnet start mysql¾ÍûÓÐÕâ¸ö´íÎóÌáʾÁË!
*************
2
MySQLµÄ1067´íÎó
Q£ºÎÒµÄMysqlÅöµ½ÁË 1067 ´íÎó
´íÎóÐÅϢΪ£º
......

ËÄÖÖÔÚMySQLÖÐÐÞ¸ÄrootÃÜÂëµÄ·½·¨

 <>ÕûÀíÁËÒÔÏÂËÄÖÖÔÚMySQLÖÐÐÞ¸ÄrootÃÜÂëµÄ·½·¨,¿ÉÄܶԴó¼ÒÓÐËù°ïÖú!
·½·¨1£º ÓÃSET PASSWORDÃüÁî
¡¡¡¡mysql -u root
¡¡¡¡mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('newpass');
·½·¨2£ºÓÃmysqladmin
 
¡¡¡¡mysqladmin -u root password "newpass"
¡¡¡¡Èç¹ûrootÒѾ­ÉèÖà ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ