[臬榜/ l) k& }, U O& v8 S
mysqldump -u userid -e -p db_Name > xxxxx.sql
, r) l7 P( q- u. d, q2 \ s$ S m5 j臬箔table:mysqldump -p -u userid dbname tablename > 52avtv_dzx20.201506242307.sql2 T4 S$ t, `. N* Y
臬箸鞈摨: mysqldump -p -u userid --all-databases > all-database.sql
1 l" m7 p9 K0 G7 Z+ V) L 雿,臬啁桃鞈摨怎雿輻刻撣唾撖蝣潭憿,隞仿舀鞈摨怠交,雿輻刻撣唾銋亙臬箸頛摰
( t6 R5 ~7 z& S[芸臬箇瑽] : https://iter01.com/206843.html
; R4 v3 \7 c8 c% k; Fmysqldump--opt-d鞈摨怠-uroot-p>xxx.sql5 u$ l7 S* J c+ d* }: r/ x' g& a# i
[芸臬箄]6 H3 B& S4 l, i# Z( G2 L
mysqldump-t鞈摨怠-uroot-p>xxx.sql+ {; M9 `; \% N |
- j* j1 a8 ?$ ~! V5 _瘜冽: 嗡誑銝餈唳隞文隞賣蝬脩箇 "502 bad gateway",敶梢踹迸ginx,芾 --single-transaction --quick 撠勗末鈭,憒銝:
' T0 ]+ }$ G1 [: e0 c9 Imysqldump -u userid -e -p --single-transaction --quick db_Name > xxxxx.sql- y5 K# K8 ^" I5 F& c
憿:mysqldump: Got error: 1017: Can't find file: 'pre_forum_rsscache' (errno: 2) when using LOCK TABLES, m5 C' {" c4 ~, K6 ^ c
Sol: 芾皂ysqldump銝--lock-tables=false撠勗臭誑閫瘙箏憿
9 ~* K, c) y# B! K. @( y+ t& ^亥箇: 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瑼:, m- I* l0 O$ J
-rw-rw---- 1 mysql mysql 8852 Jun 3 16:05 pre_forum_rsscache.frm- B! R% P! z" P3 n" q
-rw-rw---- 1 mysql mysql 0 Jun 3 16:05 pre_forum_rsscache.MYD1 f' h2 L! J9 o" f5 V3 _" W G
-rw-rw---- 1 mysql mysql 1024 Jun 3 16:05 pre_forum_rsscache.MYI
, b8 ^& h! k6 X* T8 R6 L, ~" cSol: 6 ~3 z1 S8 ^, ~* k
私hpmyadmin ==SQL 銝隞:7 Y4 \& p ^6 Y+ o/ Z
- 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
銴鋆賭誨蝣
, w B3 a+ R+ P3 _0 j, z隞賢停甇撣訾
+ E, o9 n* H' a2 s2 S) y: p憿: 嗡蝙皂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)
$ a2 { R) P6 s# Q) ]Sol: open_files_limit(default=962) 憭芸,寧4096,望澆撅祆廝ead-only,/etc/my.cnf
- d' s% N% y! `( s嗅 service mariadb restart
, ]* Q' ^4 P" L# k' m
0 Y2 ^6 K. \: ^3 G5 x[璇隞嗅臬榜
% x: b* [2 v$ c2 ]" @mysqldump -u撣唾 -p撖蝣 -h銝餅 鞈摨 鞈銵 -w "sql璇隞" > 箄撓頝臬瑼獢
( h1 n7 W# t0 Z3 e" M# K靘:9 m* v3 A; g' [ h4 g, Y/ _+ G1 y
mysqldump -uroot -p123456 -hlocalhost -e AREA_UTF8 city -w "c_id<10 " > /home/web/a.txt
B1 {; w* Y: {: m* W, ]- U . D+ V4 A: I% c. A
--no-create-info嚗-t
! G% x: [6 Y5 P: j! @1 d芸箄嚗銝瘛餃 CREATE TABLE 隤伐憒撠箸澆搴QL隤伐芣insert into典
, Q8 Z( [" }& p% _--no-data嚗-d
5 Y- B" \4 p: n銝撠箔遙雿鞈嚗芸箄摨怎瑽
/ t x: H9 S. a! v! i* b--quick嚗-q
3 g7 t, k A. P2 V% l; B- b1 a典箏之鞈敺剁撘瑕嗅 MySQL Server 亥岷敺閮湔亥撓綽銝臬敺閮敺摮刻園銝准
$ }: ]3 y4 L4 t0 M7 @2 m: r/ D, m9 ]4 S6 l
# o& B) S( U" I/ j9 F5 O$ U
[臬包
. v4 l3 s( P7 f3 K& z& xmysql -u userid -p [-h localhost] db_Name < xxxxx.sql& K9 w j2 N/ N- T$ G g! [
臬交鞈摨: mysql -u userid -p < all-database.sql! z* z% F3 X) y1 j' p. o3 p
臬乩table :! w6 R7 v0 l1 t( f6 G; X
mysql -u userid -p -D dbname < cc5278_dzx20.ip2c.201506242307.sql% r4 T' o0 o, @3 v: {
P.S憒臬交憭芸之憒7GB,臬交獢銋瑁銝隞:2 l- T- O, r& {" E
mysql -uroot -p -e "set global net_buffer_length=1000000; set global max_allowed_packet=1000000000;"% q; F2 d, X6 ^
8 q0 S- u4 A* K
[臬箏蝡喳臬亙啣虫唬蜓璈]1 b0 B( r1 V8 Q h3 `9 E
mysqldump -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 1 @) c- J; X9 b+ Q- t2 m( g# s
[閮剖臬乩(批2Mb) by phpmyadmin]
- b6 g5 r! q" `+ yhttp://www.av4u.info/forum.php?m ... e=1&extra=#pid203486 e5 E' u6 l/ K# i; n2 p
) y5 x. A1 K8 }; q9 K$ ?' f: N; ?, ]/ I
1 ?3 g* i5 i3 N* p3 H8 w$ y
$ @ j' u5 e- [% s& D
" u( [( {4 X- q& w8 P5 Z) i# J a% `- C8 \: Y. p: @
3 F; B# ^: z* A; }4 y
0 ]8 J3 t- D+ h+ a5 K
- e4 U7 v5 `, r" C4 p! \( ?4 ^0 v
% f1 d0 _3 Z6 Q( G* N0 F
, k+ G ?1 _% F4 x) g! j" }, M
: t, {, M0 F6 p! `4 U7 | N( s
n6 N9 v) a2 r4 _8 @4 W0 A7 J$ h9 g2 ^7 V9 P2 r
|
|