[臬榜& u E% \2 @' G7 n
mysqldump -u userid -e -p db_Name > xxxxx.sql
2 L) ~" Z# I) h) I臬箔table:mysqldump -p -u userid dbname tablename > 52avtv_dzx20.201506242307.sql
* N- @1 a' ?7 f, ?) f7 c臬箸鞈摨: mysqldump -p -u userid --all-databases > all-database.sql 1 O( l7 ]( Q/ d* p- J- O
雿,臬啁桃鞈摨怎雿輻刻撣唾撖蝣潭憿,隞仿舀鞈摨怠交,雿輻刻撣唾銋亙臬箸頛摰
4 S5 s8 J$ D/ B- p[芸臬箇瑽] : https://iter01.com/206843.html6 [' l* B& {/ n
mysqldump--opt-d鞈摨怠-uroot-p>xxx.sql0 v3 y0 P7 N" z1 x9 ^
[芸臬箄]
: d0 h |% o! Z' b/ Smysqldump-t鞈摨怠-uroot-p>xxx.sql" v( ^$ _1 b, X; ?
% Y- D% s+ }* [/ m
瘜冽: 嗡誑銝餈唳隞文隞賣蝬脩箇 "502 bad gateway",敶梢踹迸ginx,芾 --single-transaction --quick 撠勗末鈭,憒銝:, M E+ E g+ }# L
mysqldump -u userid -e -p --single-transaction --quick db_Name > xxxxx.sql
! \/ U1 T! X5 E憿:mysqldump: Got error: 1017: Can't find file: 'pre_forum_rsscache' (errno: 2) when using LOCK TABLES
5 Z. S0 y- N# W. K/ CSol: 芾皂ysqldump銝--lock-tables=false撠勗臭誑閫瘙箏憿- K* Z+ s* D }+ r) B# r
亥箇: 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瑼:7 b- ` W" p9 {' c6 F& o, i* N0 p
-rw-rw---- 1 mysql mysql 8852 Jun 3 16:05 pre_forum_rsscache.frm
, C o6 [- O! |, y$ t7 p5 F-rw-rw---- 1 mysql mysql 0 Jun 3 16:05 pre_forum_rsscache.MYD3 x3 @* V; u, M8 h
-rw-rw---- 1 mysql mysql 1024 Jun 3 16:05 pre_forum_rsscache.MYI
$ q a8 b- N% {4 ^. y& }3 Z2 GSol: * ?( w( U0 S- |/ K; _8 |
私hpmyadmin ==SQL 銝隞:
& e' g Z$ V" j- e0 U% L$ c- 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
銴鋆賭誨蝣
1 e3 T3 P) H: X( t, ]9 ~隞賢停甇撣訾
$ ]; I3 F. j6 @憿: 嗡蝙皂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)
! {3 c* r8 D/ \. P2 | T. y3 LSol: open_files_limit(default=962) 憭芸,寧4096,望澆撅祆廝ead-only,/etc/my.cnf
, ]' [+ l0 p2 ] j1 C* Q2 {嗅 service mariadb restart! Q6 j- p) ?1 c( X
" H$ [8 \& _$ [2 v0 a( B[璇隞嗅臬榜
7 B5 I8 Z% ]2 v! \1 ^2 d# kmysqldump -u撣唾 -p撖蝣 -h銝餅 鞈摨 鞈銵 -w "sql璇隞" > 箄撓頝臬瑼獢
' r( k7 ?" O4 T' W7 x) f6 w靘:
k9 q0 c+ X7 lmysqldump -uroot -p123456 -hlocalhost -e AREA_UTF8 city -w "c_id<10 " > /home/web/a.txt" D1 E: l8 f- Z& ?3 i! k8 Q
$ [: o4 K7 M$ T$ {2 a- ]--no-create-info嚗-t
" I" ?- J' H) p, ~芸箄嚗銝瘛餃 CREATE TABLE 隤伐憒撠箸澆搴QL隤伐芣insert into典. S! w9 n1 ^. W
--no-data嚗-d
+ g: ?& o }; `6 r. y [* F0 G銝撠箔遙雿鞈嚗芸箄摨怎瑽5 g4 F0 f4 @% h3 J
--quick嚗-q
. T s' a, E5 S( x i典箏之鞈敺剁撘瑕嗅 MySQL Server 亥岷敺閮湔亥撓綽銝臬敺閮敺摮刻園銝准
$ v8 ?; l, l* Y' {4 X- r$ l/ V6 n0 l9 a6 a" e# o* |4 r# }" K
( C9 n: J7 Z& r3 L: r" }# V w[臬包
" o2 e. |3 W8 K$ Emysql -u userid -p [-h localhost] db_Name < xxxxx.sql
0 }; F+ I- X) R4 r5 A0 b2 \臬交鞈摨: mysql -u userid -p < all-database.sql) o) t% m- }( f, j
臬乩table :2 M2 ], w# p, Q1 N
mysql -u userid -p -D dbname < cc5278_dzx20.ip2c.201506242307.sql$ g# W9 I0 ?5 R& T$ m3 o, b, b
P.S憒臬交憭芸之憒7GB,臬交獢銋瑁銝隞:
1 z7 u, k" \' `" \mysql -uroot -p -e "set global net_buffer_length=1000000; set global max_allowed_packet=1000000000;"
5 l A+ O1 @- S- G0 h; @) I# W3 |( j8 e0 Y. \6 h7 |2 i- z
[臬箏蝡喳臬亙啣虫唬蜓璈]
7 R$ d# H* j; u( n8 Vmysqldump -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
# O9 R! r/ S9 k3 [7 T" p& K[閮剖臬乩(批2Mb) by phpmyadmin]8 f# j1 ?4 S% ?" _9 r
http://www.av4u.info/forum.php?m ... e=1&extra=#pid20348
F5 s; U6 c7 D; e% Z$ w9 w1 }6 h1 n1 J& ]( N( z1 n# x
% _3 j' _- _( x/ c. T6 n+ `1 O g1 M
5 I- _- J+ C! G0 f- `2 b4 O& h) c
8 t3 z% Q s6 x' e
7 ^4 [% X' a6 N6 A
2 k/ W8 y p4 O' r. t) A) ~3 T% W+ {/ L+ l# Y
8 d6 a- s. K; s* E2 d
! c* `& ]8 R4 d8 s2 d m1 g: a9 X9 ?
1 |& P2 P: J# P, }1 P3 P4 {5 q& o# V2 P! i$ _+ N
, A2 t5 W4 X# r0 Y: I6 o! J) K) @/ C- j2 U& q
|
|