[臬榜& ]# _. k1 t$ Z0 Q2 k, [
mysqldump -u userid -e -p db_Name > xxxxx.sql! Y6 i: i6 j( x6 ]2 E, U
臬箔table:mysqldump -p -u userid dbname tablename > 52avtv_dzx20.201506242307.sql- u8 r: \' A& e7 d
臬箸鞈摨: mysqldump -p -u userid --all-databases > all-database.sql ) z, ]- N l% S7 B0 U# I% n t( I
雿,臬啁桃鞈摨怎雿輻刻撣唾撖蝣潭憿,隞仿舀鞈摨怠交,雿輻刻撣唾銋亙臬箸頛摰. P. [5 M. E) {
[芸臬箇瑽] : https://iter01.com/206843.html
& N+ X6 [/ ]7 f+ p3 x. K! H/ H, ^' Qmysqldump--opt-d鞈摨怠-uroot-p>xxx.sql
+ _! S8 i$ b/ U3 [$ k& H8 \[芸臬箄]
0 A; j- K( H8 Q% Z$ lmysqldump-t鞈摨怠-uroot-p>xxx.sql5 P# F: h$ T5 m+ o# ?3 {
$ [6 H' `1 c- y, @9 J% w5 _# C
瘜冽: 嗡誑銝餈唳隞文隞賣蝬脩箇 "502 bad gateway",敶梢踹迸ginx,芾 --single-transaction --quick 撠勗末鈭,憒銝:
1 f1 I! e" s9 E' J4 \9 i Xmysqldump -u userid -e -p --single-transaction --quick db_Name > xxxxx.sql0 t Z( N- A8 {5 k
憿:mysqldump: Got error: 1017: Can't find file: 'pre_forum_rsscache' (errno: 2) when using LOCK TABLES7 ]% @0 I3 r- Z1 f" E
Sol: 芾皂ysqldump銝--lock-tables=false撠勗臭誑閫瘙箏憿7 W* w! d k8 t6 L
亥箇: 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瑼:4 l0 [* l1 o% f& h+ v% w
-rw-rw---- 1 mysql mysql 8852 Jun 3 16:05 pre_forum_rsscache.frm
% y1 v& Q/ _7 ?-rw-rw---- 1 mysql mysql 0 Jun 3 16:05 pre_forum_rsscache.MYD/ L: A- q3 V! K, L3 y4 r
-rw-rw---- 1 mysql mysql 1024 Jun 3 16:05 pre_forum_rsscache.MYI; {' A/ r! G* k1 ]) S _
Sol:
6 r' l+ h( i" g8 u ]6 }& ]! c; _私hpmyadmin ==SQL 銝隞:
; x+ s& f$ S$ S( u: ]$ z/ F- 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
銴鋆賭誨蝣 ! e/ ^" y4 L/ S2 [
隞賢停甇撣訾
- F' E% u: N7 [憿: 嗡蝙皂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)+ N1 m9 H. e* K1 ~' z, O7 I( `
Sol: open_files_limit(default=962) 憭芸,寧4096,望澆撅祆廝ead-only,/etc/my.cnf ; \' s" e' `0 H/ u$ I
嗅 service mariadb restart
5 b0 ~9 y+ F0 G/ R8 k. X7 c& b1 D( U" @2 G. W
[璇隞嗅臬榜' g7 o& S* G. @8 Y; g; F+ U7 m# M5 G
mysqldump -u撣唾 -p撖蝣 -h銝餅 鞈摨 鞈銵 -w "sql璇隞" > 箄撓頝臬瑼獢. K: [8 r. n5 O9 q# U
靘:3 L# L P- A8 ~0 Q
mysqldump -uroot -p123456 -hlocalhost -e AREA_UTF8 city -w "c_id<10 " > /home/web/a.txt$ S! n f* ~1 y7 Q
5 r& W6 C$ @0 A' } j6 n1 L--no-create-info嚗-t
# s E- ]- r8 \芸箄嚗銝瘛餃 CREATE TABLE 隤伐憒撠箸澆搴QL隤伐芣insert into典
5 E$ \5 x1 g' r$ E--no-data嚗-d
% l/ B7 o! K7 q, f銝撠箔遙雿鞈嚗芸箄摨怎瑽1 f& m& c7 }9 ?- g; u% B. [
--quick嚗-q @; w% c4 D2 J% s7 B$ n
典箏之鞈敺剁撘瑕嗅 MySQL Server 亥岷敺閮湔亥撓綽銝臬敺閮敺摮刻園銝准
5 E9 O& O/ L1 \2 o
6 |* }6 W& g" r ]% |& K' j6 w; C$ P. f% S; H
[臬包/ g9 d5 @+ k& ^6 |
mysql -u userid -p [-h localhost] db_Name < xxxxx.sql8 O: r" g2 u( h8 u
臬交鞈摨: mysql -u userid -p < all-database.sql
' s( h: p( u/ N% \臬乩table :
2 k) d" ~2 I, l* J0 z. {5 {mysql -u userid -p -D dbname < cc5278_dzx20.ip2c.201506242307.sql5 C% ]: ]* c8 X5 Z7 c
P.S憒臬交憭芸之憒7GB,臬交獢銋瑁銝隞:
* k' ^5 j9 O/ x! I; y/ fmysql -uroot -p -e "set global net_buffer_length=1000000; set global max_allowed_packet=1000000000;"
% B$ e6 R2 z! I
: J+ B$ S5 a5 K$ I0 I& [[臬箏蝡喳臬亙啣虫唬蜓璈]
0 l0 P: m/ d( |' Emysqldump -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 ; z- A0 X. w$ k2 [. @- T' }
[閮剖臬乩(批2Mb) by phpmyadmin]. w. a/ |8 M9 {: @, {2 {
http://www.av4u.info/forum.php?m ... e=1&extra=#pid203481 T6 v7 k5 P" ?5 i
5 N5 E m( A ^" C! N" }
" o8 |/ e1 O# \; j2 i1 R
8 W. z+ L/ i* A2 o! {$ [7 ]" g# [: v9 y& e
" i$ v6 |9 [6 r1 _, n& w
! Z1 l6 P! k# r3 ]
( p+ l; e7 D. P7 P7 D
2 ~) O9 s S% f4 r5 h
9 w1 ` d$ W2 b1 @- x- j" P% w
% A( ~* t. k+ y9 P- _7 L W! P u8 h7 V% R: w9 h4 W$ \3 J$ ~
0 U8 A \/ |- P2 Q, q( q' `' M* B' B8 |- f5 }0 H
?% J2 [: Q G5 ?8 Z* U/ \9 | |
|