MySQLÂÒÂëÎÊÌâ ¿ì°ÑÎÒÕû·èÁË - Web ¿ª·¢ / ÆäËû
ÖÐÎÄÂÒÂëÎÊÌâ
ÓÃinsert²åÈëÊý¾Ý¿âµÄÖÐÎÄÊÇÂÒÂë
ÒÔÏÂÊÇÎÒ²éѯµÄÊý¾Ý¿âµÄ ±àÂ뷽ʽ
Êý¾Ý¿âmilk ÏÂÃæÓбí staff
·Ö±ðÖ´ÐÐÁË ÏÂÃ漸ÌõÃüÁî
show create table staff;
show full fields from staff;
show create database milk
show variables like '%char%';
show variables like '%coll%';
select * from staff;
insert into staff(staffname,work,password,useful) values ("ÕÅÈý","ÉóºË","
1","ÓÐЧ");
²¢¸½Óзµ»Ø½á¹û
ÁíÍâÎÒÔٸÿâ»ù´¡ÉÏ×öÁËÒ»¸öϵͳ£¬Í¨¹ýϵͳÍùÀïÃæ²åÈëÊý¾ÝÕý³£ µ«ÊÇÖ±½ÓÖ´ÐÐÔöɾ²é¸ÄµÈÓï¾ä¾Í»á³öÏÖÖÐÎÄÂÒÂëµÄÎÊÌâ
ϵͳÓõÄÊÇStruts2+Spring+hibernate¿ª·¢µÄ
Çó´ó¼ÒÖ¸µãÃÔ½ò
Enter password: ****
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 11 to server version: 5.0.22-community-nt
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> use milk
Database changed
mysql> show create table staff;
+-------+-----------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-----------------------------------------+
| Table | Create Table
|
+-------+------------------------------------------
Ïà¹ØÎÊ´ð£º
ÎÒÓõÄÊÇÁ¬½Ó³Ø×öµÄ£¬ÅäÁ¬½Ó³ØµÄ·½·¨Ó¦¸ÃûÓÐ´í£¬ÎªÊ²¾ÍÊdzöÏÖÕâÖÖÎÊÌâ
javax.servlet.ServletException: javax.naming.NameNotFoundException: No object bound to name java:comp/env/test
ÇëÎÊ´óÏÀÃÇÕâÊÇÔ ......
¸÷λÐÖµÜÇë½Ì Ï£¬ÔÚmysqlÖÐÄܲ»ÄÜʵÏÖÕâÑùÒ»¸ö¹¦ÄÜ£¬
Ò»¸ö×Ö¶ÎAÊÇ´¢´æÒ»´ó¶ÎÎÄ×ÖÄÚÈݵģ¬ÊÇÓ¢ÎÄ£¬Äܲ»ÄÜͨ¹ýMYSQLµÄ²éѯ֮ÀàµÄ¹¦ÄÜ£¬À´»ñµÃÕâ¸ö×Ö¶ÎÖÐ ³öÏÖƵÂÊ×î¸ßµÄÊ®¸öµ¥´Ê£¬²¢½«ÕâÊ®¸öµ¥´Ê×öΪеÄ×ֶδ¢´æ
a ......
String sqlCount="select count(*) from usertable where username='"+
userName+"'";Õâ¾ä»° ʲôÒâ˼°¡£¡
Õâ¾ä»°Êä³ö³öÀ´¾ÍÊÇ
select count(*) from usertable where username='ÄãµÄ±äÁ¿ ......
ÎÒÊǸöÐÂÊÖ£¬Íû¸ßÊÖ½â´ð
ÎÒÏÖÔÚÒѾ°²×°ÁËmysql£¬Ò²ÓÐmysqlµÄjdbc¡£µ«ÎÒÔõôÅäÖú󣬲ÅÄÜÔÚMyEclipseÀï²Ù×÷mysqlÄØ£¿Çë¸ßÊÖ˵Ïêϸµã
´ò¿ªMyeclipse----window---open perspective---MyEclipse database explorer-- ......
ÓÃmysql½¨±íʱ³öÏÖ´íÎó1067 £ºinvalid default value for 'id'
idÊÇintÐ͵ģ¬ÎªÊ²Ã´²»ÄÜÉèÖÃĬÈÏÖµ¡£Óï¾äΪid int£¨4£©default '-1' null;³öÏÖ´íÎó¡£
Ìù³öÄãµÄ create table Óï¾ä£¬¼°ÄãµÄmysql °æ±¾¡£
µ±ÄúµÄÎÊ ......