[臬榜2 C$ u% U+ M! N
mysqldump -u userid -e -p db_Name > xxxxx.sql
2 M: s1 G1 S2 H$ q9 h臬箔table:mysqldump -p -u userid dbname tablename > 52avtv_dzx20.201506242307.sql9 Y8 o! P- o* }
臬箸鞈摨: mysqldump -p -u userid --all-databases > all-database.sql 4 a" L% ?. ^2 f) L, g' U6 s, Z
雿,臬啁桃鞈摨怎雿輻刻撣唾撖蝣潭憿,隞仿舀鞈摨怠交,雿輻刻撣唾銋亙臬箸頛摰
) Z2 i; v6 g' u( K[芸臬箇瑽] : https://iter01.com/206843.html# l, r8 ]( C) G. J& \3 P0 Q o3 _
mysqldump--opt-d鞈摨怠-uroot-p>xxx.sql
% q! }* W! s% u7 N3 S0 E( {[芸臬箄]
3 s% h3 X: u0 F+ t% Omysqldump-t鞈摨怠-uroot-p>xxx.sql
1 K; l) T3 L, p( \% j3 @7 h! W- u) d7 U) n* O4 d1 A T
瘜冽: 嗡誑銝餈唳隞文隞賣蝬脩箇 "502 bad gateway",敶梢踹迸ginx,芾 --single-transaction --quick 撠勗末鈭,憒銝:
5 W! c: |9 [0 R+ Y$ }! kmysqldump -u userid -e -p --single-transaction --quick db_Name > xxxxx.sql9 Y. A5 m: ^& D/ d( ^, X
憿:mysqldump: Got error: 1017: Can't find file: 'pre_forum_rsscache' (errno: 2) when using LOCK TABLES
+ f9 u) E) K" |, QSol: 芾皂ysqldump銝--lock-tables=false撠勗臭誑閫瘙箏憿5 C3 g$ G5 h2 D$ l s7 w+ O* z& B
亥箇: 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瑼:
$ V6 ^9 E" m. ^' j' V" {& y-rw-rw---- 1 mysql mysql 8852 Jun 3 16:05 pre_forum_rsscache.frm i* ^5 l' W5 c3 q% j$ P
-rw-rw---- 1 mysql mysql 0 Jun 3 16:05 pre_forum_rsscache.MYD
. p6 G& l& {; V( ^, a& t-rw-rw---- 1 mysql mysql 1024 Jun 3 16:05 pre_forum_rsscache.MYI% C/ ?5 e, d8 d) Y$ m% P
Sol:
) V( m& D+ f1 b0 B. S私hpmyadmin ==SQL 銝隞:/ o6 M+ A' k, z$ l- B
- 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
銴鋆賭誨蝣 9 i/ a; E" `2 R" r/ e
隞賢停甇撣訾: E0 G( `5 l$ e1 r! E* D
憿: 嗡蝙皂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)
6 T1 R' {) H5 i) U4 [( RSol: open_files_limit(default=962) 憭芸,寧4096,望澆撅祆廝ead-only,/etc/my.cnf : A5 _+ ^5 M2 N! ?! y) A4 @
嗅 service mariadb restart4 e$ j2 S- ~; u( s% w* Y L
: ]: l4 h# d# A1 c& w, B. K
[璇隞嗅臬榜5 o) i% ]1 U2 z% @9 ]2 M5 N
mysqldump -u撣唾 -p撖蝣 -h銝餅 鞈摨 鞈銵 -w "sql璇隞" > 箄撓頝臬瑼獢. q! R4 x- c9 Y0 V) K
靘:; A/ V9 L7 S2 w9 \9 r. j+ F
mysqldump -uroot -p123456 -hlocalhost -e AREA_UTF8 city -w "c_id<10 " > /home/web/a.txt7 S# p7 X$ Z. ?) o6 q
% R, h' T8 |# u+ G--no-create-info嚗-t
0 R I5 v/ \+ x/ p6 y芸箄嚗銝瘛餃 CREATE TABLE 隤伐憒撠箸澆搴QL隤伐芣insert into典6 U ]" T0 P3 m
--no-data嚗-d6 [' P0 W% m8 h
銝撠箔遙雿鞈嚗芸箄摨怎瑽
1 x1 M2 R5 B' A; O--quick嚗-q & Z# t# y! a% d& Q9 ~" F
典箏之鞈敺剁撘瑕嗅 MySQL Server 亥岷敺閮湔亥撓綽銝臬敺閮敺摮刻園銝准
) @1 H; y- q2 r) a8 c, @( z% d
6 {# r4 y9 z2 W; C" D5 J- A& V
4 u9 ?- R, L* y$ g) D- D, J[臬包
; [* y" }5 ~! H, b7 j$ _$ Hmysql -u userid -p [-h localhost] db_Name < xxxxx.sql
% T# i' ^0 A( ~. o2 e; ]3 t臬交鞈摨: mysql -u userid -p < all-database.sql2 H, m. z6 P+ C) x
臬乩table :( h0 k, G9 x% n( j3 W3 _
mysql -u userid -p -D dbname < cc5278_dzx20.ip2c.201506242307.sql
1 r2 q1 }) T' S0 j" A9 m% y; rP.S憒臬交憭芸之憒7GB,臬交獢銋瑁銝隞:; A0 k |0 R+ f/ [" q. S
mysql -uroot -p -e "set global net_buffer_length=1000000; set global max_allowed_packet=1000000000;"
, }1 j2 H( R2 w
: |" I1 [) R* ^[臬箏蝡喳臬亙啣虫唬蜓璈]
( U( } `& `! Q, F4 q+ hmysqldump -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
) @ ~4 n. c' s4 k[閮剖臬乩(批2Mb) by phpmyadmin]
W; B$ }( b$ |4 rhttp://www.av4u.info/forum.php?m ... e=1&extra=#pid20348& d9 [, d% Q0 e; Q
. ]* f; \: Z9 T2 C" I% D/ ?# j
9 D+ `$ q# u! V# X
5 E. n' I! Q0 }
: ~. {( X# N$ u6 q r. g4 |# \+ ?& T# F5 i
) U9 U5 c$ @1 C0 D4 I. t; s- ~$ f, B
' i3 M# Q: ~: p; w9 p0 U" G# i) }( j$ h. z( Q" ^5 n
5 w3 w4 p! g* `* c/ L3 T
1 E/ i" U- { e* f, {$ |' T( L9 Z
2 ^+ R9 U* ?9 ]+ b# S1 y/ t: O/ A' e/ Q6 O
|
|