[臬榜7 w) E- T/ M& X- y
mysqldump -u userid -e -p db_Name > xxxxx.sql
) p# B2 u& q* R+ D$ V8 r" ^3 ^5 P臬箔table:mysqldump -p -u userid dbname tablename > 52avtv_dzx20.201506242307.sql
. h! E+ X/ R- {/ g; Y2 u5 T M( w臬箸鞈摨: mysqldump -p -u userid --all-databases > all-database.sql
* ~; h: X" ~" g, W4 H4 i9 o 雿,臬啁桃鞈摨怎雿輻刻撣唾撖蝣潭憿,隞仿舀鞈摨怠交,雿輻刻撣唾銋亙臬箸頛摰
" ~8 t7 I4 t; q% s6 P$ Q[芸臬箇瑽] : https://iter01.com/206843.html
1 z7 m7 i2 ~8 w0 d( qmysqldump--opt-d鞈摨怠-uroot-p>xxx.sql
' K" s+ n6 R/ \% t[芸臬箄]( e9 r9 H6 K- T9 D2 A
mysqldump-t鞈摨怠-uroot-p>xxx.sql
3 t7 l: ?: ]" l: _+ V5 a3 g s5 Z6 X# h; j# u: k C
瘜冽: 嗡誑銝餈唳隞文隞賣蝬脩箇 "502 bad gateway",敶梢踹迸ginx,芾 --single-transaction --quick 撠勗末鈭,憒銝:
U* |! {. W: V: W }& L1 ~mysqldump -u userid -e -p --single-transaction --quick db_Name > xxxxx.sql
; j Y" Z% l5 @$ w. V憿:mysqldump: Got error: 1017: Can't find file: 'pre_forum_rsscache' (errno: 2) when using LOCK TABLES
( ^3 E" l" |/ W. Z2 q- t* YSol: 芾皂ysqldump銝--lock-tables=false撠勗臭誑閫瘙箏憿/ Z; l& v/ i( ]% A$ ^: n
亥箇: 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瑼:
# [, K$ [: U: V) {7 o) g/ N$ }-rw-rw---- 1 mysql mysql 8852 Jun 3 16:05 pre_forum_rsscache.frm
* Y5 `7 ?8 p. u4 S. h-rw-rw---- 1 mysql mysql 0 Jun 3 16:05 pre_forum_rsscache.MYD
! T0 J: c1 p( [0 ^-rw-rw---- 1 mysql mysql 1024 Jun 3 16:05 pre_forum_rsscache.MYI* k2 J/ u3 j+ t& Q# B5 X
Sol:
6 U# {& @0 I# Q' H- ?7 W" q6 \( b私hpmyadmin ==SQL 銝隞:1 c: H- ?' j. P+ [0 A
- 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
銴鋆賭誨蝣
$ i9 _. ^. j {. ~. m隞賢停甇撣訾
4 |+ w0 E- e1 Z4 j, c6 r憿: 嗡蝙皂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)
( h; q, `( I* YSol: open_files_limit(default=962) 憭芸,寧4096,望澆撅祆廝ead-only,/etc/my.cnf 0 r O7 ]- n2 x6 i2 x/ |+ A
嗅 service mariadb restart5 c7 N& a6 n) P+ R; Y1 Q9 O/ ~
+ P1 ?/ _; }) A) ~& ][璇隞嗅臬榜, p% D% g0 Y/ |3 t& f
mysqldump -u撣唾 -p撖蝣 -h銝餅 鞈摨 鞈銵 -w "sql璇隞" > 箄撓頝臬瑼獢7 D) ~) J3 O) u) D1 v/ e# }
靘:* c( N* h* j, i7 c7 t% h
mysqldump -uroot -p123456 -hlocalhost -e AREA_UTF8 city -w "c_id<10 " > /home/web/a.txt9 _: H; X( c8 n2 K
3 L% R$ r) n: L) J
--no-create-info嚗-t! t( H; J! q1 O. `, g) ]
芸箄嚗銝瘛餃 CREATE TABLE 隤伐憒撠箸澆搴QL隤伐芣insert into典' a. U4 P2 e' i: a! Y- M: R$ P
--no-data嚗-d
( V' x9 y* E" s* Q銝撠箔遙雿鞈嚗芸箄摨怎瑽
1 b, p- h7 @6 K--quick嚗-q
" v# X+ ~$ \( L) K6 O$ y% v% S: _典箏之鞈敺剁撘瑕嗅 MySQL Server 亥岷敺閮湔亥撓綽銝臬敺閮敺摮刻園銝准: N# d# V2 B4 f7 i+ m
, W- w0 ~0 T B6 b+ |; C0 `
0 [' M8 i4 V( O! |9 b
[臬包1 t( E! `+ E& p4 @6 k
mysql -u userid -p [-h localhost] db_Name < xxxxx.sql; `- I: r7 M z4 @0 m$ r0 H
臬交鞈摨: mysql -u userid -p < all-database.sql; X: U* W1 t- s4 ^% O
臬乩table :0 R6 ]3 a4 B! m$ I/ X# t% T. |5 i
mysql -u userid -p -D dbname < cc5278_dzx20.ip2c.201506242307.sql
( g. z5 A( `. l5 ?- cP.S憒臬交憭芸之憒7GB,臬交獢銋瑁銝隞:
, y& d& x" U/ b' Y$ }$ U# C8 {' nmysql -uroot -p -e "set global net_buffer_length=1000000; set global max_allowed_packet=1000000000;"
/ f" m6 @/ p0 r$ s& B* v r- Y, L. w0 K# }' U% G
[臬箏蝡喳臬亙啣虫唬蜓璈]
U5 I! T0 E8 Xmysqldump -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
: s9 Q6 y4 t2 L! x; Z' ^[閮剖臬乩(批2Mb) by phpmyadmin]# o+ ]4 @ p0 F k8 K5 U" U
http://www.av4u.info/forum.php?m ... e=1&extra=#pid20348
9 |! ] Z7 y6 e9 l; q
* E0 @0 q0 z) p+ D& j& t9 |# r0 ?8 o$ l2 Y8 y
& g1 n! \1 b- T5 F- l; k( {% Y8 ]% B) |/ k2 r
+ o$ P7 H4 j8 }; p
! h* n2 s) B# d4 p
5 O! K+ Y# o- ]6 ?
( E6 B2 o2 Y, o5 S; ?5 }( y, W
& A/ {" d5 U+ {2 e) e; q
; I! K- K! ^3 I7 D2 y
1 M: L7 O! `4 F. {' B5 y" u: I4 ?; U7 t/ C3 b$ a
- t- N1 k9 Q0 E6 g# f9 t |
|