高分求mysql创建数据库及表的代码? 求mysql数据库代码
\u9ad8\u5206\u6c42\u4e2amysql\u6570\u636e\u5e93\u5efa\u5efa\u5e93\u5efa\u8868#\u521b\u5efa\u6570\u636e\u5e93test\uff0c\u5e76\u4e14\u8bbe\u7f6e\u5176\u5b57\u7b26\u96c6\u4e3aUTF-8
create
database
test
character
set
'utf8';
#\u4f7f\u7528use
\u8fdb\u5165\u6570\u636e\u5e93\uff0c\u5bf9\u6570\u636e\u5e93\u8fdb\u884c\u76f8\u5173\u64cd\u4f5c
use
test;
#\u521b\u5efa\u8868\u683cuser
create
table
user(
name
varchar(30)
not
null
primary
key
unique,age
int(3),sex
char(4),
birthday
date,adress
varchar(50),tel
varchar(13),ipcode
varchar(6));
\u8fd9\u90fd\u662f\u57fa\u7840\u9898\uff0c\u6211\u76f8\u4fe1\u4f60\u53ef\u4ee5\u641e\u5b9a\uff0c\u5982\u679c\u9047\u5230\u96be\u7684\uff0c\u641e\u4e0d\u5b9a\u7684\u518d\u6765\u627e\u6211\u5427
mysql> SHOW DATABASES;
+----------+
| Database |
+----------+
| mysql |
| test |
| tmp |
+----------+
mysql> USE test
Database changed
mysql> GRANT ALL ON menagerie.* TO your_mysql_name;
mysql> CREATE DATABASE menagerie;
mysql> USE menagerie
Database changed
shell> mysql -h host -u user -p menagerie
Enter password: ********
8.4.2 创建一个数据库表
创建数据库是容易的部分,但是在这时它是空的,正如SHOW TABLES将告诉你:
mysql> SHOW TABLES;
Empty set (0.00 sec)
使用一个CREATE TABLE语句指定你的数据库表的布局:
mysql> CREATE TABLE pet (name VARCHAR(20), owner VARCHAR(20),
-> species VARCHAR(20), sex CHAR(1), birth DATE, death DATE);
VARCHAR对name、owner和species列是个好的选择,因为列值将会是变长的。这些列的长度都不必是相同的,而且不必是20。你可以挑选从1到255的任何长度,无论哪个对你来说好象最合理。(如果你做了较差的选择,以后会变得你需要一个更长的字段,MySQL提供一个ALTER TABLE语句。)
动物性表可以用许多方法表示,例如,"m"和"f",或也许"male"和"female"。使用单个字符"m"和"f"是最简单的。
为birth和death列使用DATE数据类型是相当明显的选择。
绛旓細mysql> CREATE DATABASE menagerie;mysql> USE menagerie Database changed shell> mysql -h host -u user -p menagerie Enter password:8.4.2 鍒涘缓涓涓暟鎹簱琛 鍒涘缓鏁版嵁搴鏄鏄撶殑閮ㄥ垎锛屼絾鏄湪杩欐椂瀹冩槸绌虹殑锛屾濡係HOW TABLES灏嗗憡璇変綘锛歮ysql> SHOW TABLES;Empty set (0.00 sec)浣跨敤涓涓狢REATE ...
绛旓細1銆 杩愯鍩熷悕锛坔ttp://test.hk1123.51php.com/phpmyfaq锛夊惎鍔ㄥ畨瑁呭悜瀵笺2銆 閰嶇疆mysql鏁版嵁搴杩炴帴鍜岀鐞嗗憳淇℃伅銆侫銆丳lease add your database connection setup information 璇锋坊鍔犳暟鎹簱淇℃伅 SQL server host锛歭ocalhost 锛堟暟鎹簱杩炴帴鏂瑰紡锛屾湰鍦拌繛鎺ワ級SQL username锛 51php_51php.com 锛堟暟...
绛旓細鐢╯qlmap鑷甫鐨刲ib_mysqludf_sys.so鍗冲彲瑙e喅 鍦ㄨ繖涓綅缃 \sqlmap-master\udf\mysql\linux\32\
绛旓細浣犲畨瑁呭畬mysql浠ュ悗锛屽氨鍙互寤虹珛澶氫釜鏁版嵁搴撱傛庝箞寤猴紵杩沵ysql鏁版嵁搴撶鐞嗚蒋浠讹紝濡傛灉浣犵敤鐨勬槸phpmyadmin锛屽垰杩涘幓鐨勬椂鍊欙紝灏辨湁涓涓浣鏂板缓鏁版嵁搴鐨勬銆傚鏋滄槸鐢‵ront杞欢鐨勮瘽锛屽彸鍑讳綘鐨勬暟鎹簱鏈嶅姟鍣紝灏卞彲浠ユ柊寤轰簡銆傝繖浜涗竴鐪嬪氨鐭ラ亾浜嗐傜敱浜庝笉鑳藉彂鍥撅紝鎴戞病鏈夊姙娉曠粰浣犲彂鍥捐В璇淬傜劧鍚庡畨瑁匬HPwind鐨勬椂鍊欙紝閲岄潰鏈...
绛旓細寤虹珛涓涓 grade 琛ㄤ唬琛ㄥ鐢熺殑鎴愮哗绛夌骇,骞舵彃鍏鏁版嵁: 鏌ヨ鎵鏈夊鐢熺殑 s_no 銆乧_no 鍜 grade 鍒椼 鎬濊矾鏄,浣跨敤鍖洪棿 ( BETWEEN ) 鏌ヨ,鍒ゆ柇瀛︾敓鐨勬垚缁 ( degree ) 鍦 grade 琛ㄧ殑 low 鍜 upp 涔嬮棿銆 鍑嗗鐢ㄤ簬娴嬭瘯杩炴帴鏌ヨ鐨勬暟鎹: 鍒嗘瀽涓ゅ紶琛ㄥ彂鐜,person 琛ㄥ苟娌℃湁涓 cardId 瀛楁璁剧疆涓涓湪 card 琛ㄤ腑...
绛旓細浣犵殑鑾峰緱鍜屼娇鐢ㄩ兘鍦ㄤ竴涓瓧娈甸噷鍚楋紵搴旇鏈夋墍鍖哄垎鍚э紵濡傛灉鏈夊尯鍒嗗氨濂藉姙锛屽鏋滃湪涓涓瓧娈甸噷锛屽張娌℃湁鍖哄垎灏变笉濂藉鐞嗕簡锛屼緥鏈変釜鍖哄垎瀛楁锛宼ype 1 鏄幏鍙栵紝-1鏄娇鐢 SELECT member_id, date_format(FROM_UNIXTIME( `time`),'%y') sdate,count(point) as a, FROM `琛ㄥ悕` where type = 1 ...
绛旓細public void actionPerformed(ActionEvent arg0){ if(arg0.getSource==ButtonAdd1){ db = new MysqlManager("com.mysql.jdbc.Driver","jdbc:mysql://127.0.0.1:3306/addressbook", "root", "123456");db.Update("insert into user values ('"+TextFieldAdd1.getText().trim()+"' , '"+...
绛旓細/*mysql_connect();mysql_query();row = mysql_fetch_array();姝ら儴浠栬鍙傝冩墜鍐岃ˉ鍏 / return $row;} formatRet = array();for($i = 1; $i< 1000; $i++){ //灏1000鏀规垚浣鏁版嵁搴涓渶澶х殑ID row = getdata($i);nameArr = explode(',', $row['name']);foreach($nameArr as...
绛旓細j2ee鏋舵瀯鐨勶紝浠ュ墠姣旇緝鍑哄悕鐨勬湁jive锛屾渶杩戜笉澶叧娉ㄨ繖涓紝涓嶅お娓呮浜嗐
绛旓細杩涘叆mysql锛屾彁绀虹涓嬭緭鍏ワ細use 浣犳暟鎹瓨鏀剧殑鏁版嵁搴鍚嶅瓧锛屽洖杞 update 浣犺緭閿欐棩鏈熺殑閭d釜琛ㄧ殑鍚嶅瓧 set 杈撻敊鏃ユ湡鐨勯偅涓瓧娈=鈥樹綘鏈熸湜鐨勬棩鏈熲檞here 杈撻敊鏃ユ湡鐨勯偅涓瓧娈 ='浣犺緭閿欑殑閭d釜鏃ユ湡' 锛涘洖杞 姣斿璇达細浣犺緭閿欐棩鏈熺殑閭d釜瀛楁鍚嶆槸borndate,浣犵殑琛ㄥ悕瀛楁槸user锛屼綘杈撻敊鐨勬棩鏈熸槸1986-06-04閭e懡浠ゅ氨鏄...