[臬榜
. @" f, l5 ~: M! \: zmysqldump -u userid -e -p db_Name > xxxxx.sql
* V& U- E: y$ k臬箔table:mysqldump -p -u userid dbname tablename > 52avtv_dzx20.201506242307.sql& N! `- ~$ ^* e3 o1 O r3 B% g
臬箸鞈摨: mysqldump -p -u userid --all-databases > all-database.sql
" j) u2 M) t" s7 i* N9 q( p9 i 雿,臬啁桃鞈摨怎雿輻刻撣唾撖蝣潭憿,隞仿舀鞈摨怠交,雿輻刻撣唾銋亙臬箸頛摰
4 r8 K, d7 I5 N7 b[芸臬箇瑽] : https://iter01.com/206843.html1 F) |8 Y. c. g) D0 |9 V
mysqldump--opt-d鞈摨怠-uroot-p>xxx.sql
& S& n2 V) m8 E# Z1 D+ }' l" K4 u[芸臬箄]
+ c! i7 P' o" e4 ]mysqldump-t鞈摨怠-uroot-p>xxx.sql
1 V# K6 i) ?2 D7 f7 i
) |8 Z9 P( z2 d: u3 F3 |0 g: Q5 ?瘜冽: 嗡誑銝餈唳隞文隞賣蝬脩箇 "502 bad gateway",敶梢踹迸ginx,芾 --single-transaction --quick 撠勗末鈭,憒銝:& d' H/ p% O4 c3 i7 Y
mysqldump -u userid -e -p --single-transaction --quick db_Name > xxxxx.sql
% E- X1 Y; F/ W t憿:mysqldump: Got error: 1017: Can't find file: 'pre_forum_rsscache' (errno: 2) when using LOCK TABLES
' `6 d. d8 P9 t! r8 A1 kSol: 芾皂ysqldump銝--lock-tables=false撠勗臭誑閫瘙箏憿, T9 g$ T& h6 {( I* g
亥箇: mysqldump: Couldn't execute 'show create table `pre_forum_rsscache`': Can't find file: 'pre_forum_rsscache' (errno: 2) (1017),隞叼hpmyadmin餃交亦餌pre_forum_rsscache 雿輻其葉ls /var/lib/mysql/52avtv_dz/pre_forum_rsscache* 潛曉芣 pre_forum_rsscache.frm 1瑼獢 ,甇撣豢閰脰3瑼:5 V" E) {9 ~1 \7 N+ F9 S0 ~
-rw-rw---- 1 mysql mysql 8852 Jun 3 16:05 pre_forum_rsscache.frm
9 \1 o3 M5 S6 B; f4 K7 q-rw-rw---- 1 mysql mysql 0 Jun 3 16:05 pre_forum_rsscache.MYD
9 e( A8 ~3 L5 T! r. p: W-rw-rw---- 1 mysql mysql 1024 Jun 3 16:05 pre_forum_rsscache.MYI
! w7 q& r5 n% d/ v0 V: d7 ySol:
1 @9 ^9 D+ ]) { a: n私hpmyadmin ==SQL 銝隞:
N! ^8 t9 [2 x' x2 Q7 i% l7 {8 M- DROP TABLE IF EXISTS pre_forum_rsscache;
- CREATE TABLE pre_forum_rsscache (
- lastupdate int(10) unsigned NOT NULL DEFAULT '0',
- fid mediumint(8) unsigned NOT NULL DEFAULT '0',
- tid mediumint(8) unsigned NOT NULL DEFAULT '0',
- dateline int(10) unsigned NOT NULL DEFAULT '0',
- forum char(50) NOT NULL DEFAULT '',
- author char(15) NOT NULL DEFAULT '',
- `subject` char(80) NOT NULL DEFAULT '',
- description char(255) NOT NULL DEFAULT '',
- guidetype char(10) NOT NULL DEFAULT '',
- UNIQUE KEY tid (tid),
- KEY fid (fid,dateline)
- ) ENGINE=MYISAM DEFAULT CHARSET=utf8
銴鋆賭誨蝣
& y" ]1 _7 v# U3 J# h6 j' X隞賢停甇撣訾
, c( @( D1 V/ K+ L* b; o2 h6 V$ F- P7 C憿: 嗡蝙皂ariadb 5.5.68 隞賣箇頡rror:mysqldump: Couldn't execute 'SHOW TRIGGERS LIKE 'pre\_portal\_topic\_pic'': Can't read dir of './db_name/' (errno: 24) (1018)
9 R) x" Z8 C0 q2 G4 l- y# `Sol: open_files_limit(default=962) 憭芸,寧4096,望澆撅祆廝ead-only,/etc/my.cnf ; g* V0 y: Y1 z: W9 a7 i- n4 j3 S
嗅 service mariadb restart5 ]+ C0 r1 |# U- p
2 f& x5 K4 B" X3 s8 [# z9 S9 V) e7 J[璇隞嗅臬榜8 j) |' X; |0 A7 H6 s, ?6 e( d. X' N
mysqldump -u撣唾 -p撖蝣 -h銝餅 鞈摨 鞈銵 -w "sql璇隞" > 箄撓頝臬瑼獢
: ]2 ^* f7 o% g' Y$ G/ Y) \靘:
}$ A2 z+ e( W) }7 w$ z' _1 xmysqldump -uroot -p123456 -hlocalhost -e AREA_UTF8 city -w "c_id<10 " > /home/web/a.txt
. P1 i/ M9 b( u4 i2 X1 s5 h
( [9 B, O' p+ }) \3 g( \--no-create-info嚗-t; X0 S G8 U$ X
芸箄嚗銝瘛餃 CREATE TABLE 隤伐憒撠箸澆搴QL隤伐芣insert into典- Z7 V8 G( g; @. r' B
--no-data嚗-d
$ s: V1 u3 Y* J銝撠箔遙雿鞈嚗芸箄摨怎瑽/ g+ m& H2 K2 Z
--quick嚗-q % h) d# U) v7 u
典箏之鞈敺剁撘瑕嗅 MySQL Server 亥岷敺閮湔亥撓綽銝臬敺閮敺摮刻園銝准. i" U: L9 H: B8 |9 R- j3 P
& [" N5 c* r2 y7 d1 l3 l/ @
2 I+ _6 }1 N% ~8 l' D4 K. l[臬包/ g0 ]3 r2 H# o; m# |( O
mysql -u userid -p [-h localhost] db_Name < xxxxx.sql
* P( w; E, E0 D* b臬交鞈摨: mysql -u userid -p < all-database.sql
! g9 p2 J4 {2 ]8 I, m3 n臬乩table :
: h( U3 s4 F1 z6 `& jmysql -u userid -p -D dbname < cc5278_dzx20.ip2c.201506242307.sql+ v: E; }6 ]( _2 L1 G9 \1 p; _
P.S憒臬交憭芸之憒7GB,臬交獢銋瑁銝隞:
* v- a ?) k3 Y7 ]1 p, I9 Lmysql -uroot -p -e "set global net_buffer_length=1000000; set global max_allowed_packet=1000000000;"9 M4 m! P/ f& Q7 j- z
; n0 E2 c# I, Z
[臬箏蝡喳臬亙啣虫唬蜓璈]
/ t+ X5 {( b- l! y- U; e1 N0 Vmysqldump -u [SOURCE_userid] -h [SOURCE_IP] -e -q --password=[SOURCE_PASSWORD] SOURCE_db_Name | mysql -u [DISTANCE_userid] --password=[DISTANCE_PASSWORD] -h [DISTANCE_IP] DISTANCE_db_Name
( F }7 ^# ^3 t) v; ?( c) D" d[閮剖臬乩(批2Mb) by phpmyadmin]
- }- K7 ^* q' `2 i6 m) o/ Hhttp://www.av4u.info/forum.php?m ... e=1&extra=#pid20348" E. _' W. Z3 W h
9 `& d9 ^! e$ G3 ^
8 H) \0 K4 m2 E) H2 I6 m
$ a. C+ v7 j1 W6 s5 D3 R
/ J/ ^- H6 M! _! `* c1 H% i3 J* |! t: }) B* j
- Z* T: V3 \: o" Z
0 z3 S: U& [3 P ~- T* ?& T4 V8 O1 V) A% C! `8 w
& |" b. n0 k; o8 P% D; J( k. i9 }8 o7 q' g
; T& ^6 d# E) Q R
- U' k. I' R% M- h, e
' _3 J% W7 |" ~( f1 G) V2 u' J: s3 d1 }, @2 v
|
|