* x9 t* M4 a$ |' l9 Y/ y" a# _[root@localhost ~]# mysql -u root -p + s, N" h6 ]1 J. |Enter password: $ y/ b" N6 ]. B6 E7 sWelcome to the MySQL monitor. Commands end with ; or \g. % P0 A/ _0 y( N* e$ qYour MySQL connection id is 2- s: A( X8 s- K' K. P+ }
Server version: 5.1.52 Source distribution4 o1 R* I* Z N1 W" ?# d
Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. % f! }) [" }" h* ]This software comes with ABSOLUTELY NO WARRANTY. This is free software, + V2 s T0 L! k. d5 T. Fand you are welcome to modify and redistribute it under the GPL v2 license : m& u) `1 {; g5 U+ ^, ]0 c% \% _ # P- j- H$ Y0 |" ~$ V8 s; u1 X+ T* C( O3 {1 T/ N# }
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. : v5 y$ ]2 s! ]8 H. G A$ B, ?5 w. x1 G0 q- B; i9 Y# u
: w( z0 K/ S' r" N: p0 @% dmysql> grant all privileges on *.* to test@localhost identified by '1234567'; //第一個星號是database,第二個星號是table . }) y8 s) Q2 v" H! Q# P7 ~/ b! T3 c3 W8 c4 Z
3 t7 w! C8 P* }5 l. N+ q
Query OK, 0 rows affected (0.00 sec) //建立test帳號本機權限* Q# t' z6 G' D) h& D* G
2 e t" e1 r; u' r6 b: B& ]
9 V$ S/ C# ?1 N; Y% y: C
mysql> grant all privileges on *.* to test@192.168.1.2 identified by '1234567'; 2 ]/ Z2 { W/ `% V7 w) Y' _* L; J1 v' `3 l' r" v8 h' `' o