找回密码
 注册
查看: 14|回复: 0

数据库使用root用户直接登录问题解决

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2025-2-15 08:00:01 | 显示全部楼层 |阅读模式
[root@streamcontrolle ~]# mysql -uroot -p" P4 e, r' I! c- c( ^( B
Enter password: # z8 X& E4 T' X7 W) w
Welcome to the MariaDB monitor.  Commands end with ; or \g.
; t) n7 O& c3 `& u' JYour MariaDB connection id is 162 M, m, W% Q7 K# n4 `& c/ N! Q
Server version: 10.5.27-MariaDB MariaDB Server4 Z# A. L6 R2 X# `
. J/ G& z4 A* d
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.! E! B) N: ~. _" n/ S5 _3 f
' C# z' ^" h* N1 K% c9 l
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.$ @# K  }2 z" Y  }% t

8 a( i# T9 P: P4 |! Q0 ^) N0 LMariaDB [(none)]> exit1 u0 @( G; b3 g4 M
Bye
' T& p0 _" p1 M% y; ]1 f% q[root@streamcontrolle ~]# mysql -uroot -p8 E4 x- l, P& y
Enter password:
+ ?1 o8 w" t7 @+ F2 s$ |! cWelcome to the MariaDB monitor.  Commands end with ; or \g.4 J; {1 O/ n+ h5 ]( k- F
Your MariaDB connection id is 17$ Y6 i% V- H1 p! C( |
Server version: 10.5.27-MariaDB MariaDB Server
8 ]# e7 X" n7 J6 m' C0 X8 G
  X. _( P( v4 O9 ~Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.0 n( H4 ]& T! Q4 u, E8 b
% W; _" C$ T) |. c4 \/ A, \
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.  s9 L  v7 B+ _; Z! b

4 u* u, h- Q1 a7 R6 D) OMariaDB [(none)]> select * from mysql.user ;4 p2 Z  N$ W7 I% d/ w/ e0 i
+-----------+-------------+-------------------------------------------+-------------+-------------+-------------+-------------+-------------+-----------+-------------+---------------+--------------+-----------+------------+-----------------+------------+------------+--------------+------------+-----------------------+------------------+--------------+-----------------+------------------+------------------+----------------+---------------------+--------------------+------------------+------------+--------------+------------------------+---------------------+----------+------------+-------------+--------------+---------------+-------------+-----------------+----------------------+-----------------------+-------------------------------------------+------------------+---------+--------------+--------------------+
1 e6 A: l, Z5 D2 g, W| Host      | User        | Password                                  | Select_priv | Insert_priv | Update_priv | Delete_priv | Create_priv | Drop_priv | Reload_priv | Shutdown_priv | Process_priv | File_priv | Grant_priv | References_priv | Index_priv | Alter_priv | Show_db_priv | Super_priv | Create_tmp_table_priv | Lock_tables_priv | Execute_priv | Repl_slave_priv | Repl_client_priv | Create_view_priv | Show_view_priv | Create_routine_priv | Alter_routine_priv | Create_user_priv | Event_priv | Trigger_priv | Create_tablespace_priv | Delete_history_priv | ssl_type | ssl_cipher | x509_issuer | x509_subject | max_questions | max_updates | max_connections | max_user_connections | plugin                | authentication_string                     | password_expired | is_role | default_role | max_statement_time |
) O2 t+ p( ^7 a( d6 @/ R1 k+-----------+-------------+-------------------------------------------+-------------+-------------+-------------+-------------+-------------+-----------+-------------+---------------+--------------+-----------+------------+-----------------+------------+------------+--------------+------------+-----------------------+------------------+--------------+-----------------+------------------+------------------+----------------+---------------------+--------------------+------------------+------------+--------------+------------------------+---------------------+----------+------------+-------------+--------------+---------------+-------------+-----------------+----------------------+-----------------------+-------------------------------------------+------------------+---------+--------------+--------------------+9 T( j9 v- h/ e9 M: S: u; F# t
| localhost | mariadb.sys |                                           | N           | N           | N           | N           | N           | N         | N           | N             | N            | N         | N          | N               | N          | N          | N            | N          | N                     | N                | N            | N               | N                | N                | N              | N                   | N                  | N                | N          | N            | N                      | N                   |          |            |             |              |             0 |           0 |               0 |                    0 | mysql_native_password |                                           | Y                | N       |              |           0.000000 |
$ z) ]. o( A% L3 U| localhost | mysql       | invalid                                   | Y           | Y           | Y           | Y           | Y           | Y         | Y           | Y             | Y            | Y         | Y          | Y               | Y          | Y          | Y            | Y          | Y                     | Y                | Y            | Y               | Y                | Y                | Y              | Y                   | Y                  | Y                | Y          | Y            | Y                      | Y                   |          |            |             |              |             0 |           0 |               0 |                    0 | mysql_native_password | invalid                                   | N                | N       |              |           0.000000 |8 p  k" g) o  l6 i
| %         | test        | *94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29 | N           | N           | N           | N           | N           | N         | N           | N             | N            | N         | N          | N               | N          | N          | N            | N          | N                     | N                | N            | N               | N                | N                | N              | N                   | N                  | N                | N          | N            | N                      | N                   |          |            |             |              |             0 |           0 |               0 |                    0 | mysql_native_password | *94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29 | N                | N       |              |           0.000000 |
: q' \9 ~& Z& Y1 ~+-----------+-------------+-------------------------------------------+-------------+-------------+-------------+-------------+-------------+-----------+-------------+---------------+--------------+-----------+------------+-----------------+------------+------------+--------------+------------+-----------------------+------------------+--------------+-----------------+------------------+------------------+----------------+---------------------+--------------------+------------------+------------+--------------+------------------------+---------------------+----------+------------+-------------+--------------+---------------+-------------+-----------------+----------------------+-----------------------+-------------------------------------------+------------------+---------+--------------+--------------------+
! [8 g7 G$ M4 J% B  d- @& |$ g3 rows in set (0.002 sec)( i; I, Y9 i3 e. ?
7 B. o& P$ c# e3 `* \
MariaDB [(none)]> select * from mysql.user \G;
4 z7 z8 f, e) q9 P, K5 }*************************** 1. row ***************************
' L3 H% u" q$ ]3 k4 Z* K& e                  Host: localhost. J1 F5 `) I/ z" f- u9 H( l
                  User: mariadb.sys
4 F8 N! ]) d1 I" L: J  k              Password: ) @4 S: U* M9 @0 a
           Select_priv: N
0 U, m3 m. g9 R. v5 j3 X2 `           Insert_priv: N5 b! W) e9 i0 s. T; `
           Update_priv: N
1 P- s  f  o; C  p8 Y           Delete_priv: N3 U9 [$ ]: |: e- K4 K; \
           Create_priv: N
: J" W1 M) l! u$ L             Drop_priv: N7 V, R- u, j/ t5 C, I/ [
           Reload_priv: N
3 w+ p7 T8 K* y6 |% m" d         Shutdown_priv: N2 \: a* L9 v- Q! g2 f. A
          Process_priv: N
% b! E" \5 N7 `5 q             File_priv: N
" s; ^8 _& s! u- Y            Grant_priv: N
; d" F, V, r. Y       References_priv: N
3 _: z/ D- h$ K, C3 W) R            Index_priv: N
! N. p0 {8 g0 I( {7 I3 |            Alter_priv: N/ K% [8 y/ b# b5 L- H. x5 f) h
          Show_db_priv: N
7 p8 a4 a( q/ b9 W) e            Super_priv: N
' ]8 F8 [4 n0 o2 i) a2 y4 E) X  Q- I  L Create_tmp_table_priv: N
) z6 y6 d: J4 z" Q      Lock_tables_priv: N
6 k6 M2 a" f* a+ J% R          Execute_priv: N5 i# b" F2 J. u2 ^" Q4 T
       Repl_slave_priv: N( S* ]- J0 |5 {% `% q% Z
      Repl_client_priv: N7 }( l1 S8 Y  v1 m9 E
      Create_view_priv: N2 E. @7 c2 M" Y8 ^3 V# d2 U
        Show_view_priv: N
/ n- [7 l: E6 |- P* c2 f$ U   Create_routine_priv: N
' I! H8 D: {$ r+ p4 B! F3 G  n: i4 o    Alter_routine_priv: N0 r- T, @( b. [2 Y1 S/ L
      Create_user_priv: N
, ?5 H" Q+ v& K8 }$ ?            Event_priv: N
  A0 y- d' ?0 I1 ?# P# w          Trigger_priv: N; g' D, b0 M0 f! v
Create_tablespace_priv: N* `+ y( z7 u' B$ D
   Delete_history_priv: N
6 {5 K& z& A" n+ d) U& V, o; U              ssl_type: 6 f& R& b+ D( x; U* E, p
            ssl_cipher:
- Z( G( t; S6 N$ h6 e% u) L! o& u           x509_issuer: + j2 ~1 H# g6 G8 L
          x509_subject: & y7 r3 [5 q6 y+ H' _& a6 T# A
         max_questions: 0
* U6 \# ^; {* w/ O. Z; l1 N2 h/ }' @8 O           max_updates: 08 E; L" \4 Z( a+ h" n# g) ~
       max_connections: 0
% o- k4 ~  P: Y7 \( z2 ]8 N$ u  max_user_connections: 0
8 `6 ~0 b- F* V6 u7 V- n" J                plugin: mysql_native_password
; O0 r8 a$ m8 I6 J: S# p6 q  V3 o authentication_string:
$ ?0 Y* u" x/ M1 y$ U- H      password_expired: Y
$ g" m7 E2 C; B+ m/ d               is_role: N
0 U: Z9 h- [( Q6 g8 E! w" ~. h          default_role:
8 w$ @' _0 b1 j4 ^/ J! t1 ~) m7 I    max_statement_time: 0.0000003 S3 L" v6 ]3 j4 Z
*************************** 2. row ***************************
3 ~$ x( \1 D4 \5 I" r1 r. q; A                  Host: localhost4 m  ^5 t4 `! s' C
                  User: mysql- T) h9 b5 Y/ q, w
              Password: invalid* x  ^0 Z9 N  q" |
           Select_priv: Y
# L/ y3 K- ]6 B           Insert_priv: Y) x3 j, v" I! K  z6 w+ b5 m
           Update_priv: Y# D1 u/ C* ?/ g1 q; a2 H
           Delete_priv: Y& O5 B% z" U* Q8 Y5 m
           Create_priv: Y
- {1 I2 k0 P1 k% A             Drop_priv: Y
7 J& R  @( T/ o$ \           Reload_priv: Y
# m5 ]8 n  H+ P6 {' J         Shutdown_priv: Y) X( W; H. h8 h$ g2 Q
          Process_priv: Y4 Y: S0 I8 g! \+ \$ s
             File_priv: Y3 X, `; P! d5 C4 G  F
            Grant_priv: Y6 i: t. C1 w* d: e% C, G
       References_priv: Y& X3 A5 B' `, n8 `2 m6 v4 j
            Index_priv: Y( j5 N8 ?4 n# D" l' l2 `
            Alter_priv: Y
" o  Q: w+ y+ t" I+ G9 e, p          Show_db_priv: Y( i; d2 G+ }: T* h; O4 z
            Super_priv: Y
% D$ x, |' A4 }6 @& s7 k6 Y Create_tmp_table_priv: Y
/ `4 {' ]& N; J# d5 _      Lock_tables_priv: Y
2 H- w( `6 K- i9 _* U7 o          Execute_priv: Y
1 U4 e/ Q1 E* _  j8 k; _) T6 f       Repl_slave_priv: Y
( i0 O  W* s' a      Repl_client_priv: Y3 G1 T" y- d% \6 F4 k0 b
      Create_view_priv: Y
9 U; _5 }. H0 W/ j+ `, v% b4 R        Show_view_priv: Y' ?' B7 F, P1 J# S
   Create_routine_priv: Y
* J9 e( k: l- q2 X1 U5 b& Z  a    Alter_routine_priv: Y
1 |. x. ]1 }# |( w      Create_user_priv: Y0 N. L  R) M) W/ k: O* f
            Event_priv: Y. z" |4 S. n5 o" q- s9 _( {) f5 a
          Trigger_priv: Y
" K8 d) J1 N5 _" K  xCreate_tablespace_priv: Y
+ T& C! N' B$ c5 M. v   Delete_history_priv: Y4 Z% X4 o/ \0 w( k
              ssl_type:
/ M( A: H* \3 Y. [4 M. k  d            ssl_cipher:
& U1 _+ G# N. c0 E* F' d           x509_issuer: 5 _! T; b* X, B2 y5 V0 D
          x509_subject:
% _$ n( x# J% T8 H         max_questions: 08 b, @9 A5 s* s; ~1 B
           max_updates: 07 w4 b% B! \4 o0 G
       max_connections: 0
. S7 Y3 S5 q& @0 B8 l! _4 G  max_user_connections: 08 ?+ ]: Y# Z+ F6 b& E& ]: y( l! C
                plugin: mysql_native_password
2 O9 z* i3 |  S& t, C authentication_string: invalid
2 T( Z. x8 `) s( V" Y: J2 ^" H6 X      password_expired: N; o# P! i; w! b6 l8 [7 W8 [" ~
               is_role: N& N- }( v* m& a
          default_role: ( e1 B6 ~3 S) d: J$ f3 [% }7 W  G
    max_statement_time: 0.000000
1 W. Q9 |. C. I) k  k*************************** 3. row ***************************
# B; B! R1 x7 v9 n' Z( ]                  Host: %
8 A' G$ j1 m! N2 Y0 p7 R                  User: test  Y% ^1 o$ `- l. ^1 D& D3 A
              Password: *94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29/ W* A  K, o& c
           Select_priv: N- @, j$ ~/ x" q1 u) R1 A% B
           Insert_priv: N
! U9 f' s. ~) G3 Y# y9 N8 `           Update_priv: N$ N* J4 @. u5 g$ _, O7 J
           Delete_priv: N' V7 P# ?* g, s3 t: _7 w9 s: T7 _+ G# N
           Create_priv: N1 \# R; u3 E- o' {
             Drop_priv: N1 x7 C0 B) l" h* d9 y4 g1 e
           Reload_priv: N$ o) O: n( A5 T" S
         Shutdown_priv: N6 ~* h& G; U! @% a
          Process_priv: N& E0 r4 R/ z. s5 o) R: P5 k& W$ g
             File_priv: N4 O8 {  J( N( @* \
            Grant_priv: N
! M/ L3 ^! Q: A7 g       References_priv: N
4 O$ H* o7 r. c3 e& W            Index_priv: N
9 F9 K, l7 b" K            Alter_priv: N
: S3 h3 h  {" _) i9 u! V          Show_db_priv: N
* g, {) w2 P& A: m, ~            Super_priv: N
# T; Z3 g  P8 m Create_tmp_table_priv: N
6 r' K6 I. d2 n, Y      Lock_tables_priv: N
& L! w* c2 J; e5 R) D2 T          Execute_priv: N# P5 s6 F/ \; @" k
       Repl_slave_priv: N5 e6 Y/ Q3 d' v8 K8 R! C
      Repl_client_priv: N
' d* f* V2 n! Q& E      Create_view_priv: N2 Z! v4 m7 G& h  D$ O9 T
        Show_view_priv: N( z+ T/ N9 m* K1 I. J! l
   Create_routine_priv: N: G6 p7 k) n- a
    Alter_routine_priv: N
, ~4 t9 F# U3 l0 W" B      Create_user_priv: N# r6 t& J7 C9 |% x% J
            Event_priv: N) \1 x% t2 {: t; d+ D/ |) Z5 a8 c
          Trigger_priv: N, U0 h1 j9 }/ W! W, n2 v
Create_tablespace_priv: N
% H: t! n! c! N" u  {6 a  [   Delete_history_priv: N) I4 G$ T  `. Y/ `
              ssl_type:
6 S* S) V3 @$ G  ~$ Z            ssl_cipher: ) {( x8 W# t1 u
           x509_issuer:
6 B# t, K" i* w: h0 u          x509_subject:
, f4 p8 j9 g% N5 @$ C- y# O         max_questions: 02 D+ q. K' t1 X5 O; h/ H- Q
           max_updates: 0& a( e3 e! J) F
       max_connections: 0. ~) b# z) y: Q% H& w$ e
  max_user_connections: 0
# U) @: r! t  M1 a" ^                plugin: mysql_native_password
( ?8 e# f# l7 j6 E" A- W authentication_string: *94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29
* f. T( B4 a- M      password_expired: N
0 L5 e2 N1 f! i( m4 p               is_role: N4 ]% Y0 w3 a, r4 u3 t" }
          default_role: 7 p/ w2 ]& y6 {
    max_statement_time: 0.000000
( K& K' J% C9 M8 b% }6 B5 a3 rows in set (0.002 sec)8 M+ j/ ]; b- T

  o% u  l; T1 e1 l& i. _ERROR: No query specified3 I' Y; [" f) y! \3 U: D6 M
* C7 V# W/ _) V9 t7 @3 u$ H
MariaDB [(none)]> show variables like 'sql_safe%';7 b" d  t. ?1 i* ?( E
+------------------+-------+1 w' A; x/ }! k7 M* x( z0 w' i
| Variable_name    | Value |; V  U, `% s$ N5 X
+------------------+-------+
& \1 {2 ]' m0 E( {| sql_safe_updates | OFF   |
5 l+ o' k% v7 z$ b, T1 h1 M+------------------+-------+
/ d  P& }# o# {" z1 row in set (0.002 sec)
8 X; [/ G. c9 p, v& W  N" i) n8 O' t
MariaDB [(none)]> select * from global_priv \G;0 N2 t: |% E: l: O" w5 |
ERROR 1046 (3D000): No database selected  X; f# }+ m/ a, U' N
ERROR: No query specified& \6 s! E: U5 c  G( k! t/ w% k
/ Y. @: J4 V! A8 O  e
MariaDB [(none)]> select * from mysql.global_priv \G;
$ I! j. t# l  g" h3 z! M*************************** 1. row ***************************
1 T$ h1 I$ r8 r- A+ KHost: localhost$ w) ?6 J3 c6 F2 g1 l6 x
User: mariadb.sys
, q* n$ N+ r$ R6 P7 ePriv: {"access":0,"plugin":"mysql_native_password","authentication_string":"","account_locked":true,"password_last_changed":0}* O' L6 c1 j( C1 |
*************************** 2. row ***************************3 p3 [8 G* ~- L& I. i
Host: localhost5 j! G8 U7 c& a$ x& @
User: mysql9 w' |, I! K3 M& \
Priv: {"access":18446744073709551615,"plugin":"mysql_native_password","authentication_string":"invalid","auth_or":[{},{"plugin":"unix_socket"}]}" q" r& }; h* p
*************************** 3. row ***************************. ?( L2 q5 @& a9 I* Q6 O
Host: %5 X" `9 @. Q( G2 n& s
User: test$ r1 K+ l  C5 t0 z; q
Priv: {"access":0,"version_id":100527,"plugin":"mysql_native_password","authentication_string":"*94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29","password_last_changed":1739522769}
4 [" k- ~# V! Y% C8 V4 |, \2 ]3 rows in set (0.001 sec)) B, E8 J  ]9 y6 P* G
. `+ M8 t1 X/ [8 h# V$ c
ERROR: No query specified& I) T7 T6 B3 x( e/ }) B

  X2 _- u) _1 K2 e: |+ ?MariaDB [(none)]> select * from mysql.global_priv ;
1 X% u& Z, H+ P# n/ T+-----------+-------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+  I# E$ W; o% |  Z& ]9 L7 y, f
| Host      | User        | Priv                                                                                                                                                                     |) W6 w5 r; {4 T  a* U! R, x, T
+-----------+-------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  n* o/ F; l8 v. M" i3 a1 u| localhost | mariadb.sys | {"access":0,"plugin":"mysql_native_password","authentication_string":"","account_locked":true,"password_last_changed":0}                                                 |$ ~* f! T: p6 `* V
| localhost | mysql       | {"access":18446744073709551615,"plugin":"mysql_native_password","authentication_string":"invalid","auth_or":[{},{"plugin":"unix_socket"}]}                               |
3 S7 x$ M0 ~; V9 E| %         | test        | {"access":0,"version_id":100527,"plugin":"mysql_native_password","authentication_string":"*94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29","password_last_changed":1739522769} |
5 R7 s* \) G2 X6 B+-----------+-------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+7 Z3 P! G+ h+ U& A
3 rows in set (0.001 sec)% n  [+ i/ F: M7 P
; k/ b1 o3 o' I2 s& p! Z/ z3 T1 v

4 }9 G3 Q( Z3 S5 mMariaDB [(none)]>  select * from mysql.global_priv;$ t. M  S, |0 D
+-----------+-------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
$ o* W4 G0 b5 t( ]| Host      | User        | Priv                                                                                                                                                                                  |+ R4 U; n; v( Q' C1 i
+-----------+-------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
6 j' t4 Z" f/ E2 J| localhost | mariadb.sys | {"access":0,"plugin":"mysql_native_password","authentication_string":"","account_locked":true,"password_last_changed":0}                                                              |/ R3 L# d$ G$ E; b
| localhost | root        | {"access": 18446744073709551615, "plugin": "mysql_native_password", "authentication_string": "*C0F9333D119A6BC11CF79C9A12E656EDBBF32052", "auth_or": [{}, {"plugin": "unix_socket"}]} |7 r7 k' T# h" r" B4 U/ O$ N- @
| localhost | mysql       | {"access":18446744073709551615,"plugin":"mysql_native_password","authentication_string":"invalid","auth_or":[{},{"plugin":"unix_socket"}]}                                            |
8 m$ o; A" Y  B+-----------+-------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+% Z( x3 i! u. Z9 B% c
3 rows in set (0.001 sec)
+ T; m3 `" o. q+ \# b) x6 V$ f! ~+ b$ r" `7 J' j
MariaDB [(none)]> ALTER USER root@'localhost' IDENTIFIED VIA mysql_native_password USING PASSWORD("xxxxxxx123")
0 g+ E7 Y% J0 t# I& C  o7 z    -> ;2 q& k, g- {9 q" X, L# F- X0 h
Query OK, 0 rows affected (0.001 sec)( F' S$ X, X" g0 v- z! y

- l4 t0 [/ M5 J9 vMariaDB [(none)]>  select * from mysql.global_priv;
$ C4 z6 E6 Q" }+-----------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+) Q- {# j8 u% ]+ t  w2 o
| Host      | User        | Priv                                                                                                                                                                                                      |5 R. H# `+ n6 m
+-----------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
# V; Z: F3 I# l% D' s| localhost | mariadb.sys | {"access":0,"plugin":"mysql_native_password","authentication_string":"","account_locked":true,"password_last_changed":0}                                                                                  |( k. m+ B; d5 d7 J
| localhost | root        | {"access": 549755813887, "plugin": "mysql_native_password", "authentication_string": "*C0F9333D119A6BC11CF79C9A12E656EDBBF32052", "auth_or": [{}],"version_id":100527,"password_last_changed":1739545230} |
# _- H# V% u& n& M| localhost | mysql       | {"access":18446744073709551615,"plugin":"mysql_native_password","authentication_string":"invalid","auth_or":[{},{"plugin":"unix_socket"}]}                                                                |
, t7 i( X0 e1 w+-----------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
( w  |# T& j+ ~$ D! w( B# C2 ?3 rows in set (0.001 sec)% x3 M8 b( J. M/ L9 Y
/ @8 S: Z- a5 T) `' w" p, u

; l7 l  ]9 N5 v* _9 h& n# P- d8 Y) I+ e* z6 Z
# w: X- p4 e% Z  D" y) K, v9 `
MariaDB [(none)]> flush privileges;
9 B' ^0 d* g$ q6 B, q6 \7 A) TQuery OK, 0 rows affected (0.001 sec)
6 S, U+ |9 \2 T* C0 }. G
4 r- b, {! M8 lMariaDB [(none)]> select user, plugin from mysql.user;5 b3 D& V: ?, z! N. u
+-------------+-----------------------+* S) P6 r0 M' ]; ]
| User        | plugin                |
1 @8 R- N" W) `- H2 o" x+-------------+-----------------------+0 F$ C2 ~6 b6 k. X, y
| mariadb.sys | mysql_native_password |4 N# Q8 W, Y# H" g
| mysql       | mysql_native_password |# y% \; ^$ N# P5 D# S
| test        | mysql_native_password |2 V2 g7 U  }* M, B
+-------------+-----------------------+# U" I( _+ M0 E7 p4 E& ~
3 rows in set (0.002 sec)
3 U( o2 [6 K! Y; N! f  ^. c; U: Q' m& B( |
MariaDB [(none)]> FLUSH PRIVILEGES;
0 ~* O; j& J6 P( r) e3 CQuery OK, 0 rows affected (0.002 sec)
5 g, Y1 a6 Q  _9 X+ Z2 i& {' G, }1 ~: j! g

* s% ^4 w* Y& rMariaDB [(none)]> flush privileges;& E2 y) t- h* P: q  d  ?+ T1 I
Query OK, 0 rows affected (0.001 sec)4 T  g( a+ ]. {9 v
" @$ h% e, }8 |( h. F
7 K) m/ I) ^, z4 E& G% v: T
MariaDB [(none)]> exit9 B& e' I$ T" c  }8 t8 K2 j
Bye
! Q( v6 A2 Z( S
4 [. I5 J6 z9 s9 h- W2 a; j- u! ]2 K! N' t# z0 T. r
[root@streamcontrolle ~]# mysql -uroot -p
9 ?3 e' g6 S4 g- D) i: ~Enter password: % q6 h; W2 W, o% Y/ q- a: ]
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)! ~4 z; ?7 l. q
[root@streamcontrolle ~]# mysql -uroot -p: z. Y  Z% h  h3 d9 W7 r( O! X
Enter password: , d7 A+ m9 i+ v
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
7 H+ D9 a% H  n% P# v% ^0 l7 D7 d7 W$ {7 T% j: x0 i" [1 N8 D* h

* v! k" y# f1 Z/ p6 I. B6 p
6 ^. {5 q: v, M1 r9 t7 U
您需要登录后才可以回帖 登录 | 注册

本版积分规则

返回首页|Archiver|手机版|小黑屋|易陆发现技术论坛 ( 蜀ICP备2026014127号-1 )

GMT+8, 2026-6-12 00:10 , Processed in 0.028261 second(s), 22 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表