[臬榜
: i8 r8 {6 m) M; b+ w. h& ^mysqldump -u userid -e -p db_Name > xxxxx.sql
1 b; T: Y) B" O$ f- k: O% {臬箔table:mysqldump -p -u userid dbname tablename > 52avtv_dzx20.201506242307.sql" p/ c# E8 L: z' c! v( Q
臬箸鞈摨: mysqldump -p -u userid --all-databases > all-database.sql
; u2 }( p% x' w) Y; |8 Z$ p& y 雿,臬啁桃鞈摨怎雿輻刻撣唾撖蝣潭憿,隞仿舀鞈摨怠交,雿輻刻撣唾銋亙臬箸頛摰, [; A! l8 b( w! ?4 w. V* S
[芸臬箇瑽] : https://iter01.com/206843.html& [5 g8 d% P/ G$ o8 a" q; \
mysqldump--opt-d鞈摨怠-uroot-p>xxx.sql( H6 ]% P6 d3 w( ]1 }% ~
[芸臬箄]& S Y. }( M8 n3 b
mysqldump-t鞈摨怠-uroot-p>xxx.sql
1 W+ J7 B( g. s9 |) A0 J5 G! `" m/ U& d' s
瘜冽: 嗡誑銝餈唳隞文隞賣蝬脩箇 "502 bad gateway",敶梢踹迸ginx,芾 --single-transaction --quick 撠勗末鈭,憒銝:& v* I) ?/ ]0 ~& ]' ?( p8 _+ r; Y: F
mysqldump -u userid -e -p --single-transaction --quick db_Name > xxxxx.sql) b/ d8 D2 V& u* K
憿:mysqldump: Got error: 1017: Can't find file: 'pre_forum_rsscache' (errno: 2) when using LOCK TABLES
( ?$ O4 N X4 q) _# E& FSol: 芾皂ysqldump銝--lock-tables=false撠勗臭誑閫瘙箏憿4 e' \. h. L' e' w# ~7 ?3 d
亥箇: 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瑼:! Q( K( c; D4 E5 L0 R2 i2 {
-rw-rw---- 1 mysql mysql 8852 Jun 3 16:05 pre_forum_rsscache.frm. P9 F+ c) u$ B# }5 |
-rw-rw---- 1 mysql mysql 0 Jun 3 16:05 pre_forum_rsscache.MYD% a; o6 ?0 a, @7 |- ^& {# `1 e
-rw-rw---- 1 mysql mysql 1024 Jun 3 16:05 pre_forum_rsscache.MYI
% \ C7 g, _8 \- O7 SSol:
" m9 y* a% ^4 [" ~' [+ F: G" j私hpmyadmin ==SQL 銝隞:
, c1 R: i1 \% q9 b. 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
銴鋆賭誨蝣 , F h8 Y' D0 E+ Z. B2 Z
隞賢停甇撣訾
$ ~! P+ @% m O- |憿: 嗡蝙皂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: S8 |* BSol: open_files_limit(default=962) 憭芸,寧4096,望澆撅祆廝ead-only,/etc/my.cnf + y9 n% }; [; Y$ ~
嗅 service mariadb restart
1 {" M( t9 o% I h$ ^, M: C4 _
! o9 s+ r5 M! }: A[璇隞嗅臬榜
2 [& u: G/ C! o9 {mysqldump -u撣唾 -p撖蝣 -h銝餅 鞈摨 鞈銵 -w "sql璇隞" > 箄撓頝臬瑼獢7 C9 c# ~, T0 w1 N4 r' i" m
靘:, V5 }) o! g9 N" P: G: n
mysqldump -uroot -p123456 -hlocalhost -e AREA_UTF8 city -w "c_id<10 " > /home/web/a.txt
) H' X' @7 p- I, Q' \ ; Q( ~ m2 I7 F! _$ c
--no-create-info嚗-t
0 v7 z1 Y1 T6 }. N" U/ M+ g芸箄嚗銝瘛餃 CREATE TABLE 隤伐憒撠箸澆搴QL隤伐芣insert into典# x- s& ]. {( P: \" d, c
--no-data嚗-d
. y9 U/ ~$ G; z; B銝撠箔遙雿鞈嚗芸箄摨怎瑽
" f3 ~- n2 u8 |3 A" F0 F--quick嚗-q
* _/ g, y2 i/ B# U2 d* s1 s典箏之鞈敺剁撘瑕嗅 MySQL Server 亥岷敺閮湔亥撓綽銝臬敺閮敺摮刻園銝准
( P, ]8 U: N0 U2 z" o8 l1 N: d1 N" u! u" k* t o F4 T
1 a) D1 q7 |6 Z( W3 y3 K
[臬包
+ @6 G7 ?4 H" ^$ t) ?' xmysql -u userid -p [-h localhost] db_Name < xxxxx.sql
2 j/ u3 l4 w2 M2 K臬交鞈摨: mysql -u userid -p < all-database.sql
6 d8 _2 I3 d2 }臬乩table :/ ~! z2 c5 y" x0 F
mysql -u userid -p -D dbname < cc5278_dzx20.ip2c.201506242307.sql
" q# s2 }3 }6 r$ mP.S憒臬交憭芸之憒7GB,臬交獢銋瑁銝隞:
1 d: f! q5 f. ^ v" [3 R9 i0 w, umysql -uroot -p -e "set global net_buffer_length=1000000; set global max_allowed_packet=1000000000;"
6 w, W0 j" W$ ?6 u- P0 y! r! x9 K
[臬箏蝡喳臬亙啣虫唬蜓璈]- r# K) Z. X# a) e: z9 |
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 " |! n0 E% h1 m/ G
[閮剖臬乩(批2Mb) by phpmyadmin]6 Q% B# {" i" G: R S3 \
http://www.av4u.info/forum.php?m ... e=1&extra=#pid20348
! X4 K- z r- }# U/ |) w. {! e' V
. I+ N+ F2 I3 `8 N+ l
* l( e, s& ?# `- l/ }& \* O
, D; d( y: d) y# p% A; h1 \
) n. {* H, q2 w5 H% r9 X
7 X2 ^: @& U' m# m# b5 R( O% b9 L
5 @0 F4 d6 o8 y5 w% h+ P2 P
( b; I, A" U" }8 r" ~: m% Y/ u% S5 z
$ L; U. Y7 L' \9 o% v5 G- e; g2 M) U+ _- N3 \0 _8 k5 a8 X4 y
% @1 E! G$ ?8 J/ z0 b
5 w: r7 a! w6 H1 g: k
3 H* b$ ?. I9 \. ^5 O4 q7 h/ [! m9 f0 ?" U: ]* _: s
|
|