[臬榜
: V, n, n, C- ?3 ] xmysqldump -u userid -e -p db_Name > xxxxx.sql
% F* c4 ^, x+ }臬箔table:mysqldump -p -u userid dbname tablename > 52avtv_dzx20.201506242307.sql
$ C; ]4 |7 R& P" t% H3 a- Q臬箸鞈摨: mysqldump -p -u userid --all-databases > all-database.sql 0 N$ V8 ~7 u7 a3 {
雿,臬啁桃鞈摨怎雿輻刻撣唾撖蝣潭憿,隞仿舀鞈摨怠交,雿輻刻撣唾銋亙臬箸頛摰
3 U/ o8 v: `4 O+ l! e4 J3 s& P[芸臬箇瑽] : https://iter01.com/206843.html
5 \+ L2 H$ }4 m0 o# Emysqldump--opt-d鞈摨怠-uroot-p>xxx.sql7 P1 Q& {( J& g. r
[芸臬箄]$ X/ @5 g# F& K6 F
mysqldump-t鞈摨怠-uroot-p>xxx.sql
% m; V3 w* c! E3 x& I1 P9 f9 u+ m) N
瘜冽: 嗡誑銝餈唳隞文隞賣蝬脩箇 "502 bad gateway",敶梢踹迸ginx,芾 --single-transaction --quick 撠勗末鈭,憒銝:
$ _" y" ^: h" d7 J P" p& z* X, Hmysqldump -u userid -e -p --single-transaction --quick db_Name > xxxxx.sql) H5 ~ J+ [# @' n) e1 o
憿:mysqldump: Got error: 1017: Can't find file: 'pre_forum_rsscache' (errno: 2) when using LOCK TABLES
0 u# F4 v9 {$ G# }1 c2 SSol: 芾皂ysqldump銝--lock-tables=false撠勗臭誑閫瘙箏憿8 B+ w; j* _" _' }6 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瑼: w, U7 R2 m" e' ^" R$ l ?9 P
-rw-rw---- 1 mysql mysql 8852 Jun 3 16:05 pre_forum_rsscache.frm$ U" F }" Q( v0 }7 P
-rw-rw---- 1 mysql mysql 0 Jun 3 16:05 pre_forum_rsscache.MYD" x( m9 V3 _$ @( Y3 k. W9 t$ q
-rw-rw---- 1 mysql mysql 1024 Jun 3 16:05 pre_forum_rsscache.MYI, ^+ W Z5 q# i6 T+ F" S( F
Sol:
1 h7 Y7 L( Z8 g1 m5 B私hpmyadmin ==SQL 銝隞:
3 I! d/ @) k8 {+ O* N/ G- 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
銴鋆賭誨蝣
. Q: h$ l0 t) b9 H隞賢停甇撣訾" J3 C/ A2 m: [) n% p- Q4 `7 o' E
憿: 嗡蝙皂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)
) n, ^) N! x! I8 M7 \- OSol: open_files_limit(default=962) 憭芸,寧4096,望澆撅祆廝ead-only,/etc/my.cnf - [2 T! U s2 ~& W& L$ }
嗅 service mariadb restart& ]# Z- u1 ^. S! @8 h- W* t
v. H0 A; R6 | {) b" f[璇隞嗅臬榜2 D/ G5 \) w, g6 U
mysqldump -u撣唾 -p撖蝣 -h銝餅 鞈摨 鞈銵 -w "sql璇隞" > 箄撓頝臬瑼獢
+ y5 y/ b' Y0 l4 J靘:
8 q3 Y! @; u4 ]mysqldump -uroot -p123456 -hlocalhost -e AREA_UTF8 city -w "c_id<10 " > /home/web/a.txt% }* }) L1 l# y; C
0 S w& u3 m) j--no-create-info嚗-t
% b7 N& F* D: h& w U% N% b% s8 S7 c芸箄嚗銝瘛餃 CREATE TABLE 隤伐憒撠箸澆搴QL隤伐芣insert into典% G5 P' i; c9 P+ t+ ?" V9 z# _7 D
--no-data嚗-d
5 C- c/ U( i: M銝撠箔遙雿鞈嚗芸箄摨怎瑽
& M) Y( t. e& ]5 `1 l$ d5 j9 c--quick嚗-q ) k6 \( |; z0 k* r6 Y, d( e4 }
典箏之鞈敺剁撘瑕嗅 MySQL Server 亥岷敺閮湔亥撓綽銝臬敺閮敺摮刻園銝准' Y8 B8 h% |, ^5 H2 ` b
0 R: ?; c9 I# ~ B2 m0 ^: G) H1 M
( u9 M/ }( b# j) {2 L( k
[臬包/ q. T2 Q; s3 j' g7 }
mysql -u userid -p [-h localhost] db_Name < xxxxx.sql3 M& W2 e5 j& i& o& B6 M L
臬交鞈摨: mysql -u userid -p < all-database.sql Q, a) x; B- q0 j: @+ z7 D" T1 p
臬乩table :: y4 s! H8 l4 A" r* K
mysql -u userid -p -D dbname < cc5278_dzx20.ip2c.201506242307.sql8 }$ P' ]5 r" u# {
P.S憒臬交憭芸之憒7GB,臬交獢銋瑁銝隞:5 I4 [) ?" C, Z
mysql -uroot -p -e "set global net_buffer_length=1000000; set global max_allowed_packet=1000000000;"
0 |: e' T! X1 I6 M# U9 k
3 J A2 ?' L6 a; z[臬箏蝡喳臬亙啣虫唬蜓璈]0 O+ n3 q6 x! t
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
" }' q2 C) [5 [" i$ x7 ~[閮剖臬乩(批2Mb) by phpmyadmin]
$ x3 L+ h4 P Xhttp://www.av4u.info/forum.php?m ... e=1&extra=#pid20348/ f: a+ Z D4 r7 g9 O6 v E
8 l2 O. K; e, D% m7 I
5 z/ W+ _( ~% @& \2 n4 L( \% ~4 ^, f) k
& A- \; j4 C/ L7 A' D/ k1 T/ Q! E. }, X0 X7 A! ~7 S
1 F0 k' r9 H3 ?, f
" J/ S- {* Z8 }
& J/ e! @; e* I6 q7 E5 q- q6 q- e6 [ i7 n
2 {1 m% d% G1 ]/ T: {- h& R+ J0 L7 e2 ~# U/ }1 B& H W
5 y6 P3 j# j) j3 W3 P: D, n" I6 c: q8 P0 V" e+ K+ O
( ]9 J$ I/ J9 j- Z- w6 s
|
|