C:\mysql\bin
>
mysql?
-
u?root?
-
p
Enter?password:? ****
Welcome? to ?the?MySQL?monitor.??Commands? end ? with ?;? or ?\g.
Your?MySQL?connection?id? is ? 4
Server?version:? 5.0 .51b - community - nt?MySQL?Community?Edition?(GPL)
Type? ' help; ' ? or ? ' \h ' ? for ?help.?Type? ' \c ' ? to ?clear?the?buffer.
mysql > ?show?databases;
+ -- ------------------+
| ? Database ??????????? |
+ -- ------------------+
| ?information_schema? |
| ?mysql?????????????? |
| ?mytest????????????? |
| ?tjtz??????????????? |
| ?tjtz_148280117????? |
+ -- ------------------+
5 ?rows? in ? set ?( 0.00 ?sec)
mysql > ? create ? database ?mytest2;
Query?OK,? 1 ?row?affected?( 0.01 ?sec)
mysql > ?show?databases;
+ -- ------------------+
| ? Database ??????????? |
+ -- ------------------+
| ?information_schema? |
| ?mysql?????????????? |
| ?mytest????????????? |
| ?mytest2???????????? |
| ?tjtz??????????????? |
| ?tjtz_148280117????? |
+ -- ------------------+
6 ?rows? in ? set ?( 0.00 ?sec)
mysql > ? use ?mytest2;
Database ?changed
mysql > ? create ? table ?testTable(
???? -> ?id? int ( 4 )?auto_increment? not ? null ? primary ? key ,
???? -> ?name? char ( 10 )? not ? null ,
???? -> ?address? char ( 50 )? default ? ' jinan ' ,
???? -> ? year ?date);
Query?OK,? 0 ?rows?affected?( 0.09 ?sec)
mysql > ?show?tables;
+ -- -----------------+
| ?Tables_in_mytest2? |
+ -- -----------------+
| ?testtable????????? |
+ -- -----------------+
1 ?row? in ? set ?( 0.05 ?sec)
mysql > ? insert ? into ?testtable? values ( '' , ' zhangsan ' , '' , ' 2011-12-29 ' );
Query?OK,? 1 ?row?affected,? 1 ?warning?( 0.00 ?sec)
mysql > ? select ? * ? from ?testtable;
+ -- --+----------+---------+------------+
| ?id? | ?name????? | ?address? | ? year ??????? |
+ -- --+----------+---------+------------+
| ?? 1 ? | ?zhangsan? | ????????? | ? 2011 - 12 - 29 ? |
+ -- --+----------+---------+------------+
1 ?row? in ? set ?( 0.00 ?sec)
mysql > ? update ?testtable? set ?address = ' jiefang?road ' ;
Query?OK,? 1 ?row?affected?( 0.06 ?sec)
Rows?matched:? 1 ??Changed:? 1 ??Warnings:? 0
mysql > ? select ? * ? from ?testtable;
+ -- --+----------+--------------+------------+
| ?id? | ?name????? | ?address?????? | ? year ??????? |
+ -- --+----------+--------------+------------+
| ?? 1 ? | ?zhangsan? | ?jiefang?road? | ? 2011 - 12 - 29 ? |
+ -- --+----------+--------------+------------+
1 ?row? in ? set ?( 0.00 ?sec)
mysql > ? insert ? into ?testtable? values ( '' , ' lisi ' , null , ' 2012-1-3 ' );
Query?OK,? 1 ?row?affected,? 1 ?warning?( 0.00 ?sec)
mysql > ? select ? * ? from ?testtable;
+ -- --+----------+--------------+------------+
| ?id? | ?name????? | ?address?????? | ? year ??????? |
+ -- --+----------+--------------+------------+
| ?? 1 ? | ?zhangsan? | ?jiefang?road? | ? 2011 - 12 - 29 ? |
| ?? 2 ? | ?lisi????? | ? NULL ????????? | ? 2012 - 01 - 03 ? |
+ -- --+----------+--------------+------------+
2 ?rows? in ? set ?( 0.00 ?sec)
mysql >
Enter?password:? ****
Welcome? to ?the?MySQL?monitor.??Commands? end ? with ?;? or ?\g.
Your?MySQL?connection?id? is ? 4
Server?version:? 5.0 .51b - community - nt?MySQL?Community?Edition?(GPL)
Type? ' help; ' ? or ? ' \h ' ? for ?help.?Type? ' \c ' ? to ?clear?the?buffer.
mysql > ?show?databases;
+ -- ------------------+
| ? Database ??????????? |
+ -- ------------------+
| ?information_schema? |
| ?mysql?????????????? |
| ?mytest????????????? |
| ?tjtz??????????????? |
| ?tjtz_148280117????? |
+ -- ------------------+
5 ?rows? in ? set ?( 0.00 ?sec)
mysql > ? create ? database ?mytest2;
Query?OK,? 1 ?row?affected?( 0.01 ?sec)
mysql > ?show?databases;
+ -- ------------------+
| ? Database ??????????? |
+ -- ------------------+
| ?information_schema? |
| ?mysql?????????????? |
| ?mytest????????????? |
| ?mytest2???????????? |
| ?tjtz??????????????? |
| ?tjtz_148280117????? |
+ -- ------------------+
6 ?rows? in ? set ?( 0.00 ?sec)
mysql > ? use ?mytest2;
Database ?changed
mysql > ? create ? table ?testTable(
???? -> ?id? int ( 4 )?auto_increment? not ? null ? primary ? key ,
???? -> ?name? char ( 10 )? not ? null ,
???? -> ?address? char ( 50 )? default ? ' jinan ' ,
???? -> ? year ?date);
Query?OK,? 0 ?rows?affected?( 0.09 ?sec)
mysql > ?show?tables;
+ -- -----------------+
| ?Tables_in_mytest2? |
+ -- -----------------+
| ?testtable????????? |
+ -- -----------------+
1 ?row? in ? set ?( 0.05 ?sec)
mysql > ? insert ? into ?testtable? values ( '' , ' zhangsan ' , '' , ' 2011-12-29 ' );
Query?OK,? 1 ?row?affected,? 1 ?warning?( 0.00 ?sec)
mysql > ? select ? * ? from ?testtable;
+ -- --+----------+---------+------------+
| ?id? | ?name????? | ?address? | ? year ??????? |
+ -- --+----------+---------+------------+
| ?? 1 ? | ?zhangsan? | ????????? | ? 2011 - 12 - 29 ? |
+ -- --+----------+---------+------------+
1 ?row? in ? set ?( 0.00 ?sec)
mysql > ? update ?testtable? set ?address = ' jiefang?road ' ;
Query?OK,? 1 ?row?affected?( 0.06 ?sec)
Rows?matched:? 1 ??Changed:? 1 ??Warnings:? 0
mysql > ? select ? * ? from ?testtable;
+ -- --+----------+--------------+------------+
| ?id? | ?name????? | ?address?????? | ? year ??????? |
+ -- --+----------+--------------+------------+
| ?? 1 ? | ?zhangsan? | ?jiefang?road? | ? 2011 - 12 - 29 ? |
+ -- --+----------+--------------+------------+
1 ?row? in ? set ?( 0.00 ?sec)
mysql > ? insert ? into ?testtable? values ( '' , ' lisi ' , null , ' 2012-1-3 ' );
Query?OK,? 1 ?row?affected,? 1 ?warning?( 0.00 ?sec)
mysql > ? select ? * ? from ?testtable;
+ -- --+----------+--------------+------------+
| ?id? | ?name????? | ?address?????? | ? year ??????? |
+ -- --+----------+--------------+------------+
| ?? 1 ? | ?zhangsan? | ?jiefang?road? | ? 2011 - 12 - 29 ? |
| ?? 2 ? | ?lisi????? | ? NULL ????????? | ? 2012 - 01 - 03 ? |
+ -- --+----------+--------------+------------+
2 ?rows? in ? set ?( 0.00 ?sec)
mysql >
更多文章、技術交流、商務合作、聯系博主
微信掃碼或搜索:z360901061

微信掃一掃加我為好友
QQ號聯系: 360901061
您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。
【本文對您有幫助就好】元
