52AV璈A|52AV.ONE

 曉撖蝣
 蝡唾酉
敹急瑕
  • av隢憯BBS
  • 璈A
  • 芣瑟憭瘚
  • 鞎澆
  • 52av鋆貉摰
  • 銝剜-銝剖銝餅
     
亦: 4242|敺: 0
銝銝銝駁 銝銝銝駁

[mysql] Mysql 閮剖Login

[銴鋆賡包
頝唾唳摰璅撅
璅銝
潸” 2015-6-21 23:10:33 | 芰閰脖 撣 |摨閬 |梯璅∪
摰鋆摰Mysql 敺閮剖 :0 E1 i3 C/ ]# |6 H! [
脖甇亥身摰 MySQL
& `: e$ P! P5 J9 g, n8 o, xA.
: T0 C% P/ B- h' b1 l4 n( U0 R9 K# s4 j閮剖php.ini(/etc/php.ini)
& ?, K2 h" ?5 K% `( U3 ophp.ini
2 D* ~1 h" n0 d2 M1 memory_limit = 128M               //PHP舐刻園銝% R- G  f+ E5 D5 Z9 o5 w; b
2 display_errors = Off              //憿舐內航炊閮
7 F" c. Z% y: J$ A5 g' }- V1 S3 date.timezone = Asia/Taipei       //(銵閬閮剖嚗銝賀HP雿輻典唳賣豢航炊閮). }6 W) P( |7 A8 s' j5 `% [/ Q
4 session.cookie_lifetime = 0       //session摮瘣餅(桐蝘嚗0隞銵典瘣餉喟閬賢券)
- F# A: i* [! B* T) e
# N' R9 Q! c0 \B.( H% n# n* ^9 f* ^) ~7 n, l
閮剖my.cnf(/etc/my.cnf)
! C' f8 ?  ~( @. t* Q+ Y/ Ymy.cnf :
+ x. ~1 h, A" o. {2 Q1 log-error=/var/log/mysqld.log     //亥摮曆蝵
( M6 o2 z1 ^% Q/ J# e: t2 connect_timeout = 15              //蝺timeout
! \3 J- z0 k8 q. Y8 w1 Y& d; `3 max_connections = 3000            //憭折蝺
  m5 z$ q/ X. ^7 E4 ^$ F. u4. service mysqld  restart# b3 b3 C% f. W# d7 c" b
' o; C* e+ ~& `5 s
' ]% L3 g6 g) W9 Z! R
C.5 H; V- s. o( \9 h8 J, s
閮剖 MySQL 鞈摨怎恣 root 撣單嗥撖蝣潘瑁sudo mysql_secure_installation嚗隞雿摨銝撟曆辣鈭  P5 J8 K) V: C0 O( I- p. r
1. Enter current password for root (enter for none):  // 湔交 Enter嚗粹閮剜撖蝣! _3 P. d$ O+ q/ w6 B
2. Set root password? [Y/n]                     //頛詨  Y 靘閮剖撖蝣
+ F' u3 [% n  i3 j9 d0 N& a6 }0 M. }3. New password:                                  // 頛詨 root 啣蝣
; F, M) B9 y1 L# d' \8 c" W4. Re-enter new password:                      // 銝甈∟撓 root 啣蝣
" T4 W8 x3 _2 B5 D6 e# K% }5. Remove anonymous users? [Y/n]          //閮 Yes 嚗湔交 Enter
+ b) U+ I( \4 Z0 t1 @6. Disallow root login remotely? [Y/n]       //閮 Yes 嚗湔交 Enter+ k6 C" T  O( z* M7 [
7. Remove test database and access to it? [Y/n]    //閮 Yes 嚗湔交 Enter
) {% y" e% x- K, m% \9 \8. Reload privilege tables now? [Y/n]       //閮 Yes 嚗湔交 Enter4 s+ V. e5 }+ D3 S- D

7 s# J1 }9 F' n- m4 I/ `- Q- K1 Y3 |# L" L+ x
亥拍典閮剖 root 撖蝣潛餃 MySQL嚗瑁sudo mysql -u root -p嚗撖蝣潭迤蝣箏停脣乓mysql>璅蝷箇泵0 @; s2 j% o. z4 R) z+ [
瑁豢閬券鞈摨1 t% z# f% x3 M, P! C3 B4 y4 O8 `
mysql> use mysql
8 H" R6 V% j9 u
4 R9 x6 B" q9 ]0 |0 C4 G: B 瑁select host,user from user ;閬蝯撠暹瑁2 i' X) |! {: o4 W- P7 l
mysql> select host,user from user ;& v. g! K( k- x3 \
+-----------+------+% `3 F2 Q4 F! ?' O% y
| host      | user |
' ~# D' a) Q3 n3 }4 R+-----------+------+; H: t. W3 H! n6 h
| 127.0.0.1 | root |1 N  I7 {' h* `8 g( p0 j% u! m
| localhost | root |2 |% Q$ D/ |! E% J6 _: [
+-----------+------+, F0 t7 l/ H$ J8 L) ^2 U. i
2 rows in set (0.00 sec)8 Q. q' N- R! [
" G$ E' ~' `' |1 D
啣銝雿輻刻
4 c7 U/ J1 g+ d1 r6 jinsert into user (host,user,password) values ('%','your_account',password('your_password'));' w# d' d. ~& P2 O6 s! z

- k6 S" K' W6 f/ z餅閰脖蝙刻蝞∠甈嚗璅雿賣颲行蝡航 嚗 root 蝡舐餃亥◤鈭嚗 3 Z/ \) |" S0 b0 h" T1 E
GRANT ALL ON *.* TO 'your_account'@140.112.1.1 IDENTIFIED BY 'your_password' WITH GRANT OPTION;
3 A3 o! b* ]' ?, O& s! o( h; o銝嗅撣唾嚗芣臭祈摨思蝙刻撣唾嚗銝瘝隞颱甈
0 H8 D( D0 A4 j餉閮剖
" w7 Y: r7 R0 |1 WFLUSH PRIVILEGES;0 d6 J  W( U2 t, [
摰鋆摰Phpmyadmin ,run http://www.domain.com/dbadmin   show error : The mbstring extension is missing. Please check your PHP configuration.
6 G, f% a4 P. ]隢摰鋆2 [0 f) A5 H; Q# Y+ M
        
- d' z# x" H! Y; R5 y; iyum -y install php-mbstring
1 @; t' _; E* V. }$ ^* [2 D! t. c* U- R0 ]: y" \$ W5 u8 s! }: D
亙箇曄撩撠mcrypt嚗隢摰鋆
, r" ]# f2 I% `9 a; Y        
& j) v; _& ?' P; R$ e- E$ dyum -y install mcrypt
$ i0 ~' e" U2 Y9 B8 ~$ L  @service nginx restart6 K) E" D+ N( W" L, j% n8 B5 v4 ~) \
Login phpadmin 敺箇    error:蝻箏 mysqli 游憟隞嗚隢瑼X PHP 閮剖Solution:
4 J. {" V6 `) F% H5 _: Mphp -m | grep mysqli ===> confirm mysqli module is installed
/ i, W5 m" }/ ^- B. L7 sphp -i | grep extension_dir ===> 撠曉辣隡貊桅8 u8 G2 u5 `' Y/ I! i9 `1 q9 [
yum -y install php-mysql ( yum install php5-mysqli)   ===> ok
+ M2 W( b, X% @+ V3 e- \+ x" R蝻箏 mcrypt 游憟隞嗚隢瑼X PHP 閮剖
- l2 y5 i" a2 [: M1 q9 R4 w, O; y( [9 Ayum install php-mcrypt; g+ s; R& D, t9 u. c5 s/ r7 J6 c
yum install libmcrypt libmcrypt-devel   ===> ok1 ?: |! e4 Q6 r! Y+ |  F
3 r( I* ^+ c; C( O

  R, q5 B# x+ w9 d8 _0 ?2 q* \- O

雿輻券

祉蝛閬

撠蝝詨

砍憛批捆靘餉衣雯頝臬批捆蝝颲行粹嗥蝬脩嚗摰撟湔遛嚗嚗甇脖誑銝嗅啣摰嗆摰撟湧翩鈭箏ㄚ孵舫脣伐銝憿亙祉璇甈橘芣遛18甇 雓蝯脣亦閬賬粹脩芣遛18甇脖芣撟渡雯閬賜雯頝臭嗥批捆鞈閮嚗撱箄降典舫脰蝬脰楝批捆蝝蝯蝜ICRA蝝摰鋆閮剖 (粹蝯行霅 祉蝬脣銝蝝瘛函隢憯啣嚗祉閮剜蝞∠)

QQ|撠暺撅||52AV璈A

GMT+8, 2025-12-6 04:05 , Processed in 0.054540 second(s), 16 queries .

蝯∠.撱

52avtv@gmail.com | QQ:2405733034     since 2015-01

鋆貉憒 敹恍敺 餈銵