砍敺 IT_man 2014-12-31 09:25 蝺刻摩 " v) ?9 D! n! M( U
8 P/ B4 V5 y) A& v& ^
隤芣# b9 g) I5 w# s
MySQL鞈摨急甈祆蝡荔靘憒嚗銝撣唾蝬摰蝯奸ocalhost閰梧閰脣董芾賢決ySQL鞈摨急祆雿輻剁閬曄策蝡臭蜓璈蝺衽ySQL鞈摨思蜓璈閰梧撠勗撠撣唾蝬摰蝯阡蝡臭蜓璈雿輻剁銝嫣蝝寞孵賣舀甈芷斗甈嚗MySQL甈敺憭臭誑銝:* {4 R; x* k# F4 L
2 a' H4 Y# g) j6 P+ P- o
. C# d9 O# `, f. M
7 [- m; v8 I4 g+ E5 [鞈摨(DateBase)鈭蝔格:
# q% N* O" {5 X! S) W- e; {' Z+ x* g- X; N! G; O+ ]4 A
: h& q1 x3 _, x" e, m
ALL PRIVILEGESALTERCREATEDELETEDROPFILEINDEXINSERTPROCESSREFERENCESRELOADSELECTSHUTDOWNUPDATEUSAGE
3 d# y# r4 ]3 k, ]; d9 R, W3 v3 j! |! A0 z1 f8 a. \
1 ?2 |! C' g; u' f7 I0 n" a7 L) ]% f9 g. i' X; x. {) D" [- l
6 S/ ~ e) m5 K6 @, [3 i+ V
鞈銵(Table)怎車甈:. t% C" M( Y6 z9 |5 Y; G
4 X6 L; J+ b9 \
7 Q3 u4 {: L( a$ r* [6 x7 ~' G& JSELECTINSERTUPDATEDELETECREATEDROPINDEXALTER5 J) Y1 L: C" a4 h
4 U3 l5 N/ K/ y, ~: V* @2 b( N* H' @: @" @6 F- Q6 O: i$ e
+ |) O9 w: |! P9 x9 s
9 g& E( M$ P$ e* H鞈甈(column)銝蝔格: j& j ]% U1 q2 Z8 W
4 F1 H0 v5 \7 w3 D( ?9 b+ m
/ p; ]$ i$ U0 m" l7 p$ ]3 wSELECT INSERT UPDATE, S5 O7 n# H# K9 W h
$ T" m8 l8 \% i
1 w3 {0 m3 f# p9 j# I: i' R4 X) r+ m6 v, I1 q6 M! R% M8 D( ~
撖虫:' d4 \; ^9 A0 x: ~7 M$ O
3 W4 z" r L6 N4 a+ u
5 N1 Q7 x( L; U Z1 d[root@localhost ~]# mysql -u root -p3 @0 J. J+ f: K$ s
Enter password:
+ s- b" n( [' Z. |/ W HWelcome to the MySQL monitor. Commands end with ; or \g.. N" d# p7 o6 A/ b, V$ x& H
Your MySQL connection id is 2+ X* n$ w8 V4 c9 T5 P
Server version: 5.1.52 Source distribution: f' a; Y( n1 j: `3 D4 t) D+ U# O
Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
( U( h+ p/ S% r) v6 ^9 ^This software comes with ABSOLUTELY NO WARRANTY. This is free software,
! H, j, I8 n" M) G) v. Z4 E0 qand you are welcome to modify and redistribute it under the GPL v2 license
; E/ q& N. Y8 ?* I, I% A, e8 t6 \! f- I# u( [
m: ]! U: j% b/ }
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.) E0 e/ W7 z! s
( d- H# g [1 _$ K1 Y& s7 J+ G) T, ]3 ~" {- J8 L& p$ b7 K9 x
mysql> grant all privileges on *.* to test@localhost identified by '1234567'; //蝚砌留atabase嚗蝚砌眩able
" A" c4 e2 ^+ ~! @+ A9 M) M
' D: t( J# _6 z. _, G$ L2 m
8 _8 H* H# b& k2 |" V# U) K) BQuery OK, 0 rows affected (0.00 sec) //撱箇test撣唾祆甈) r. w) S6 @0 E- s' q
. U* W% p( q h: O- I
! v7 T( M% j6 G% [mysql> grant all privileges on *.* to test@192.168.1.2 identified by '1234567';
, V7 j9 ?3 M) B& f+ B' D0 z7 c- y T# T7 ^0 l
# Z8 Q' X7 g- j/ rQuery OK, 0 rows affected (0.01 sec) //撱箇test撣唾蝡舀' F1 U9 m& q* t2 p2 Q
" `7 j4 v, e7 `8 q3 Z1 C, O9 I
" ^; `% m4 }4 a' g0 l# o* X! Q2 K* A2 k) |
mysql> select host,user from mysql.user; //亥岷MySQL甈撣唾
2 N; A Y3 u9 W x# m
) c& e: `* l1 ~: d1 K* _9 K# J: C% |7 O7 g! \
+-----------------------+-------+
: }, C" A7 e7 ?2 z8 B| host | user |
$ q% c) r4 S% J4 }' `+-----------------------+-------+
7 ?/ q! a) E/ k) \' \| 127.0.0.1 | root |
9 N# h- q) G! t: X2 e" o| 192.168.1.2 | test | //撣唾test蝡舀甈 s; l# p5 |8 P8 _6 _
| localhost | |
1 i% x) T3 _! ^; W$ ?1 u| localhost | test | //撣唾test祆甈
~8 Y% y* l6 v' j5 S& C| localhost | root |
7 m2 g6 H5 o- N, n# A3 v| localhost.localdomain | |$ q3 k( p. R3 l# g3 O0 t3 M k1 H6 L
| localhost.localdomain | root |
6 m" g3 `& f0 c' ~& m7 n+-----------------------+-------+
( e# C- |, z' x; N- l. z7 rows in set (0.00 sec)8 z, L5 V( g! ~
. `( t$ ~4 @3 N/ ~
5 r/ k2 t: s; q/ c% S2 B) ]
mysql> quit //aMySQL1 v# s e; n) p
Bye
) ~+ }1 g: E9 H) P[root@localhost ~]# G) D0 }9 P# Y, ~% e
! Y V! T7 g7 c B
p.s 嗡mysql 閬隤瘜隢http://mail.hmes.kh.edu.tw/~jona/redhat/mysqlphp/mysqlsyntax.htm
8 B# I' a% r9 i C, k8 u8 {
. @+ N) N+ U' E. ?& Y% p7 X; g
) m x/ m$ E9 L |
|