鍦?/span> c:\mysql\bin\ 涓嬭繍琛?/span> winmysqladmin 鍚姩
2銆?span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">聽聽聽 鐧誨綍 MySQL
鍒濆鎯呭喌涓嬮粯璁ょ櫥褰曠敤鎴峰悕 root 錛屽瘑鐮佷負絀恒?/span>
鍦?/span> c:\mysql\bin 涓嬭繍琛?/span> mysql -uroot 鍗沖彲銆傚綋鎴戜滑鏂板緩鐢ㄦ埛涔嬪悗鎸変互涓嬫柟寮忥細
mysql -h(hostname) -u(username) -p(password)
3銆?span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">聽聽聽 浣跨敤鏁版嵁搴?/span>
鍒濆瀹夎涔嬪悗鏈変竴涓繚瀛樼郴緇熻〃鐨勬暟鎹簱鈥斺?/span> mysql 錛屼嬌鐢ㄤ互涓嬪懡浠ゅ彲浠ヨ闂暟鎹簱
use mysql;
4銆?span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">聽聽聽 鏂板緩 MySQL 鐢ㄦ埛
鐢?/span> root 甯愬彿鐧誨綍鍚庯紝榪涘叆 mysql 鏁版嵁搴擄紝鎵ц鎻掑叆璇彞錛?/span>
insert into user (host,user,password) values('localhost','mysql',password('mysql'));
insert into user (host,user,password) values('%','mysql',password('mysql'));
flush privileges;
榪欐牱灝變負 MySQL 寤虹珛浜嗕竴涓悕涓?/span> mysql 錛屽瘑鐮佷負 mysql 鐨勭敤鎴鳳紝絎竴涓敤浜庢湰鍦扮櫥褰曪紝絎簩涓敤浜庤繙紼嬬櫥褰曘?/span>
<!
娉ㄦ剰
:
鍦?/span>
user
涓?/span>
(host,user,password)
涔嬮棿蹇呴』鏈夌┖鏍奸殧寮
>
<! 娉ㄦ剰 : 鍦?/span> values 涓?/span> ('','','') 涔嬮棿娌℃湁絀烘牸闅斿紑錛屽瓧絎︿覆鐢ㄥ崟寮曞彿 >
5銆?span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">聽聽聽 鏂板緩鏁版嵁搴?/span>
create database test;
6銆?span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">聽聽聽 閫鍑?/span>
quit;
7銆?span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">聽聽聽 鍑犱釜鏈夌敤鐨?/span> SQL 鍛戒護錛?/span>
虜聽聽聽聽聽聽聽 show databases 錛氬湪鍒氱櫥褰曚箣鍚庛佷嬌鐢ㄦ暟鎹簱涔嬪墠鏌ョ湅鐜版湁鏁版嵁搴擄紱
虜聽聽聽聽聽聽聽 select database 錛?/span> 鏄劇ず褰撳墠鏁版嵁搴?/span>
虜聽聽聽聽聽聽聽 show tables 錛?/span> 鏄劇ず褰撳墠鏁版嵁搴撲腑鐨勬墍鏈夎〃
describe table_name 錛氭樉紺烘煇琛ㄧ殑緇撴瀯8銆?span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">聽聽聽 澶囦喚涓庢仮澶?/span> 錛?/span>
mysqldump -u username -p --opt聽 dbname >backupfileName.sql 錛氬皢鏁版嵁搴揹bname瀵煎嚭鍒?/span> backupfileName.sql鏂囦歡涓?/span> 錛?/span>
mysql dbname < backupfileName.sql錛氬仛鍙嶅悜宸ヤ綔銆?/span>
鍦ㄥ晢鐣岋紝鎴戜滑鐨勭‘閫氬父闇瑕佺‘淇濆緇堝疄鏂芥煇浜涜鍒欍備緥濡傦紝鍙備笌欏圭洰鐨勯泧鍛樺繀欏昏闆囩敤銆傛垨鑰呮兂瑕佹煇浜涗簨浠舵湁璁″垝鍦板彂鐢熴備緥濡傦紝濡傛灉閿鍞憳鍞嚭涓鎵瑰晢鍝侊紝鍒欏簲澧炲姞鍏朵劍閲戙?
DB2 閫氱敤鏁版嵁搴撲負姝ゆ彁渚涗簡涓濂楁湁鐢ㄧ殑鏂規硶銆?鍞竴綰︽潫鏄姝㈠湪琛ㄧ殑涓鍒楁垨澶氬垪涓嚭鐜伴噸澶嶅肩殑瑙勫垯銆?鍙傝冨畬鏁存х害鏉?/i>紜繚鍦ㄦ暣涓寚瀹氱殑琛ㄤ腑鏁版嵁涓鑷存с?琛ㄦ鏌ョ害鏉?/i>鏄竴浜涙潯浠訛紝瀹冧滑瀹氫箟涓鴻〃瀹氫箟鐨勪竴閮ㄥ垎錛岄檺鍒朵竴鍒楁垨澶氬垪涓嬌鐢ㄧ殑鍊箋?i>瑙﹀彂鍣?/i>鍏佽鎮ㄥ畾涔変竴緇勬搷浣滐紝榪欎簺鎿嶄綔閫氳繃瀵規寚瀹氱殑琛ㄨ繘琛屽垹闄ゃ佹彃鍏ユ垨鏇存柊鎿嶄綔鏉ユ墽琛屾垨瑙﹀彂銆傝Е鍙戝櫒鍙敤浜庡啓鍏ュ叾浠栬〃銆佷慨鏀硅緭鍏ュ間互鍙婂彂甯冭鎶ヤ俊鎭?/p>