[臬榜, l' w" s! H* i z. k
mysqldump -u userid -e -p db_Name > xxxxx.sql4 [+ W# p# ]2 R, z
臬箔table:mysqldump -p -u userid dbname tablename > 52avtv_dzx20.201506242307.sql
( L H1 s B+ j! d. B4 [3 f! N臬箸鞈摨: mysqldump -p -u userid --all-databases > all-database.sql
" w/ z1 A0 @/ e) R 雿,臬啁桃鞈摨怎雿輻刻撣唾撖蝣潭憿,隞仿舀鞈摨怠交,雿輻刻撣唾銋亙臬箸頛摰
- b* j4 n2 ]* h, P. G. E% p# m( f1 o( D[芸臬箇瑽] : https://iter01.com/206843.html+ v, u: M+ e, f9 z' y* u
mysqldump--opt-d鞈摨怠-uroot-p>xxx.sql2 P0 n+ Z+ \9 x, ?$ }7 ~% E4 |* T
[芸臬箄]. t/ N3 M+ w- h2 V. }8 k
mysqldump-t鞈摨怠-uroot-p>xxx.sql; Z4 Z: q& x& U$ p
6 ]5 A- ^; M. q2 W3 u9 b
瘜冽: 嗡誑銝餈唳隞文隞賣蝬脩箇 "502 bad gateway",敶梢踹迸ginx,芾 --single-transaction --quick 撠勗末鈭,憒銝:+ k( n7 z+ Y- v9 j F6 N0 }
mysqldump -u userid -e -p --single-transaction --quick db_Name > xxxxx.sql
: t! r& o, M% P9 s. I% Q- U憿:mysqldump: Got error: 1017: Can't find file: 'pre_forum_rsscache' (errno: 2) when using LOCK TABLES Y6 L* x# t+ ~* M1 l
Sol: 芾皂ysqldump銝--lock-tables=false撠勗臭誑閫瘙箏憿2 `; v; P2 @7 {( f8 \! I
亥箇: 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瑼:
( c$ a) [7 D% o3 v7 B% x$ o-rw-rw---- 1 mysql mysql 8852 Jun 3 16:05 pre_forum_rsscache.frm8 j2 ]- [4 `7 Q% i* _* F* L2 E
-rw-rw---- 1 mysql mysql 0 Jun 3 16:05 pre_forum_rsscache.MYD7 f% O7 ]4 ?& n& b2 g# N9 l
-rw-rw---- 1 mysql mysql 1024 Jun 3 16:05 pre_forum_rsscache.MYI" Y8 X) m& z2 F. A( w8 V
Sol: + J3 x( r% d, L3 n4 @; P1 r( L
私hpmyadmin ==SQL 銝隞:0 g9 l& |; W" W7 n; H# r
- 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
銴鋆賭誨蝣
7 x8 p: H9 @' A* K隞賢停甇撣訾
! S% `) R% E2 \! [憿: 嗡蝙皂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)1 o) w; x5 q; E2 f1 f# K6 ^( w
Sol: open_files_limit(default=962) 憭芸,寧4096,望澆撅祆廝ead-only,/etc/my.cnf / e' U1 }. m6 ]
嗅 service mariadb restart
- n I6 }% ^4 H8 H3 i6 b9 B6 C, h; @6 V
[璇隞嗅臬榜
5 g0 [1 i- @: H/ h: |. k' Q* Xmysqldump -u撣唾 -p撖蝣 -h銝餅 鞈摨 鞈銵 -w "sql璇隞" > 箄撓頝臬瑼獢/ v0 ^5 v i2 I5 g# n( w8 h# U
靘:
, |4 l* D* `9 _" \# H8 ]mysqldump -uroot -p123456 -hlocalhost -e AREA_UTF8 city -w "c_id<10 " > /home/web/a.txt) V) Y/ d# s' M: C
1 Y! C* S& B0 W/ @; n/ g8 Z--no-create-info嚗-t
, P& F6 j8 ^7 m8 \( r8 }芸箄嚗銝瘛餃 CREATE TABLE 隤伐憒撠箸澆搴QL隤伐芣insert into典
& i& v s7 G& B7 E* m' C/ g--no-data嚗-d: @. C! |! [ j" D3 [& x4 C5 Q+ G
銝撠箔遙雿鞈嚗芸箄摨怎瑽! g& V& I! o( }: E# m, ], }
--quick嚗-q 8 y+ e; v$ L8 X- w# t
典箏之鞈敺剁撘瑕嗅 MySQL Server 亥岷敺閮湔亥撓綽銝臬敺閮敺摮刻園銝准
0 n3 a0 ], `0 E; d/ O( j/ m
. X( p4 s# {! V) R% l/ }, P3 W `, h5 A" a$ T+ _
[臬包
$ T. e+ P( `# \9 \; A# m" I, ]mysql -u userid -p [-h localhost] db_Name < xxxxx.sql
1 j7 g( A/ O. [/ K. s# V臬交鞈摨: mysql -u userid -p < all-database.sql
' r* D% z2 p$ o8 M/ N, F臬乩table :6 q9 \" z/ N% F" S3 V3 t
mysql -u userid -p -D dbname < cc5278_dzx20.ip2c.201506242307.sql2 M2 F$ r0 W B/ U9 \4 F
P.S憒臬交憭芸之憒7GB,臬交獢銋瑁銝隞:; J: N8 {5 _/ v2 h
mysql -uroot -p -e "set global net_buffer_length=1000000; set global max_allowed_packet=1000000000;"
9 s' L) z0 u! Q! r5 C, M3 ]2 w5 f) T" Y9 E
[臬箏蝡喳臬亙啣虫唬蜓璈]
0 U# z' J9 E. A# i3 \. j( Q Jmysqldump -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
0 h& }( q' x# ~[閮剖臬乩(批2Mb) by phpmyadmin]
& a: A% f1 l6 d. yhttp://www.av4u.info/forum.php?m ... e=1&extra=#pid20348
9 X6 a4 F2 E8 p6 _8 W! ]- S7 B( J# I8 ~, t! R
, D2 y; ~* a# p( q- {5 ?
# R9 S0 C* |# f f# B4 ~' K' E* r; x( b6 j
9 F. u- x- A0 ~* j6 q
+ U* K! P' L/ p
( ^* k! l( o) ^3 R8 R5 Y
& m; w1 f9 a0 \! J6 k( j+ N- }
) g) h4 q a I1 P
$ D4 a) \ g( k9 G7 m: s$ s( R: v' A' E
; x; B; y/ b+ N9 z$ S: g3 Q) f! x4 H6 I( R9 d. c; f
8 q/ ~ r: I/ n) F! t
( F9 }! ] k$ U; ~+ ?8 d$ t
|
|