[臬榜
# D% g/ a% G3 r* n- A) e' rmysqldump -u userid -e -p db_Name > xxxxx.sql# G% N1 j0 h" z9 ^# {! b
臬箔table:mysqldump -p -u userid dbname tablename > 52avtv_dzx20.201506242307.sql% T5 S- c Q2 y' O
臬箸鞈摨: mysqldump -p -u userid --all-databases > all-database.sql
6 f2 t- @2 C* k. d, V 雿,臬啁桃鞈摨怎雿輻刻撣唾撖蝣潭憿,隞仿舀鞈摨怠交,雿輻刻撣唾銋亙臬箸頛摰, U3 M7 E8 e( t, G
[芸臬箇瑽] : https://iter01.com/206843.html$ X! Q" N y0 O" D) h2 R) ~5 |
mysqldump--opt-d鞈摨怠-uroot-p>xxx.sql+ g' p. }; ^! }
[芸臬箄]
7 N2 y: B" N$ Z& Omysqldump-t鞈摨怠-uroot-p>xxx.sql/ _; h( n2 L+ Y2 x$ h
' J: s( h/ k; [瘜冽: 嗡誑銝餈唳隞文隞賣蝬脩箇 "502 bad gateway",敶梢踹迸ginx,芾 --single-transaction --quick 撠勗末鈭,憒銝:& `! B* ~; K% C/ T ]. n. U1 b( g
mysqldump -u userid -e -p --single-transaction --quick db_Name > xxxxx.sql, h6 }- `. p d5 H1 G4 R ]3 S; Z
憿:mysqldump: Got error: 1017: Can't find file: 'pre_forum_rsscache' (errno: 2) when using LOCK TABLES, C0 ~7 i+ ?1 \3 X* r
Sol: 芾皂ysqldump銝--lock-tables=false撠勗臭誑閫瘙箏憿! [' F2 L( i2 ?. }; z+ {
亥箇: 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* [0 M% r f1 g- h' }* I$ @5 h-rw-rw---- 1 mysql mysql 8852 Jun 3 16:05 pre_forum_rsscache.frm
8 B0 k* W5 w2 Q; }( |+ W-rw-rw---- 1 mysql mysql 0 Jun 3 16:05 pre_forum_rsscache.MYD
/ d9 M' G$ ~( ^" Z4 b/ j4 b" E! ]-rw-rw---- 1 mysql mysql 1024 Jun 3 16:05 pre_forum_rsscache.MYI
7 ]+ L, |7 L1 B: G0 g1 pSol:
# B: P4 N: `6 H: W) M私hpmyadmin ==SQL 銝隞: Q1 f! m1 f; P- e
- 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
銴鋆賭誨蝣 4 u3 I, P T0 O4 n
隞賢停甇撣訾- T$ y) v/ @% E8 t' F
憿: 嗡蝙皂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)
0 J! U! w5 I% |. H/ P7 \Sol: open_files_limit(default=962) 憭芸,寧4096,望澆撅祆廝ead-only,/etc/my.cnf
9 F( X8 D; B- T1 W6 ]嗅 service mariadb restart2 }" S' M1 ~6 e) X9 M* B) ]( u
2 w8 f. s$ D0 i[璇隞嗅臬榜
1 U+ m) w) U: g$ C# T6 hmysqldump -u撣唾 -p撖蝣 -h銝餅 鞈摨 鞈銵 -w "sql璇隞" > 箄撓頝臬瑼獢
: {& B. E% V7 M靘:
* Y2 @" Z' d- N, r' pmysqldump -uroot -p123456 -hlocalhost -e AREA_UTF8 city -w "c_id<10 " > /home/web/a.txt" ]- h) b( x! C5 c2 [( a+ J! m
: c( c- E. u4 O- \& I! [
--no-create-info嚗-t
% R$ n9 h- L; u芸箄嚗銝瘛餃 CREATE TABLE 隤伐憒撠箸澆搴QL隤伐芣insert into典) ]: T6 c% b0 F3 f5 n* ]$ j
--no-data嚗-d3 l; \5 S" s$ j! e
銝撠箔遙雿鞈嚗芸箄摨怎瑽
/ m: H8 }- \/ z. [--quick嚗-q , w' x6 I1 ~! L* J6 y( t
典箏之鞈敺剁撘瑕嗅 MySQL Server 亥岷敺閮湔亥撓綽銝臬敺閮敺摮刻園銝准& C+ E# O7 G- e; p9 S& N1 L( b
1 P' {) t- J: b9 Q1 ?! W
: ?& G4 i5 `3 p, P
[臬包* Q1 }# T3 b4 a( W1 O6 |4 p* N
mysql -u userid -p [-h localhost] db_Name < xxxxx.sql% Q# t( z' d- Y4 r2 s# p7 ]5 a
臬交鞈摨: mysql -u userid -p < all-database.sql
3 ]) h1 I1 j* c% [% O臬乩table :
* t) {4 B) q' ~" S$ Umysql -u userid -p -D dbname < cc5278_dzx20.ip2c.201506242307.sql
9 d) B" E# T! q" r/ x1 E2 [; I, aP.S憒臬交憭芸之憒7GB,臬交獢銋瑁銝隞:& |" ~( k( i7 w2 G" [6 T" z1 l0 A
mysql -uroot -p -e "set global net_buffer_length=1000000; set global max_allowed_packet=1000000000;" _3 Y" i6 Z& J/ l
$ {) y3 m, ^9 W+ m. j) d2 m0 L
[臬箏蝡喳臬亙啣虫唬蜓璈]- Y% ?' Q5 P5 V& U; m
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 , c% F. k# G% e U
[閮剖臬乩(批2Mb) by phpmyadmin]. q9 r2 D! _2 m3 |
http://www.av4u.info/forum.php?m ... e=1&extra=#pid20348, m. D* |* U, d+ I7 y9 }
6 p3 u3 c7 K: `
- s9 @1 D1 K" h2 p. V+ n
- N. x5 {9 k; ]: T& c/ ?9 p& D, j/ M
; e" M1 j* O1 w# e0 Y" o: x
( \+ V" g& }. s! J
, Q$ H! U* ^6 V: P7 `
( {2 G7 r/ ^! {1 N
+ n- g( I+ ~/ R! K
4 ]* \# B p; t- U/ j; ^) I
, ^; I5 ]+ I& v4 D+ J9 o* R% u3 j
& \9 a8 Y- D; K2 k, c
4 k3 U- Q9 @5 S" B& T' p* \0 ?9 C$ q
|
|