[臬榜
4 V3 g) }, ]) c8 y4 P! Kmysqldump -u userid -e -p db_Name > xxxxx.sql
+ U: I! J0 g8 I5 O臬箔table:mysqldump -p -u userid dbname tablename > 52avtv_dzx20.201506242307.sql
9 P8 o# {) k0 {$ ~2 `4 b+ f+ \$ E臬箸鞈摨: mysqldump -p -u userid --all-databases > all-database.sql ( h& q& ~ |" N' C
雿,臬啁桃鞈摨怎雿輻刻撣唾撖蝣潭憿,隞仿舀鞈摨怠交,雿輻刻撣唾銋亙臬箸頛摰
' p$ n) S( t0 _8 d[芸臬箇瑽] : https://iter01.com/206843.html+ m3 B4 n7 `5 M5 q% U! j$ q( ]
mysqldump--opt-d鞈摨怠-uroot-p>xxx.sql
* x+ C8 c' u5 q! e[芸臬箄]
# Y F) b' i( _ w2 s$ pmysqldump-t鞈摨怠-uroot-p>xxx.sql5 L. |8 `7 `, a( L/ c
; \0 n) ]) G1 U7 ], Q* B6 O4 H瘜冽: 嗡誑銝餈唳隞文隞賣蝬脩箇 "502 bad gateway",敶梢踹迸ginx,芾 --single-transaction --quick 撠勗末鈭,憒銝:
' y- t! t9 K9 x; y' E5 Wmysqldump -u userid -e -p --single-transaction --quick db_Name > xxxxx.sql' n5 W5 {" @7 R0 _
憿:mysqldump: Got error: 1017: Can't find file: 'pre_forum_rsscache' (errno: 2) when using LOCK TABLES# J x- ]2 M1 \4 ~
Sol: 芾皂ysqldump銝--lock-tables=false撠勗臭誑閫瘙箏憿
, Z% V( @& W3 n- @. S0 M亥箇: 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瑼:/ d# p, M0 z7 s: }1 v
-rw-rw---- 1 mysql mysql 8852 Jun 3 16:05 pre_forum_rsscache.frm! J7 m+ _6 U0 Z1 b4 O D
-rw-rw---- 1 mysql mysql 0 Jun 3 16:05 pre_forum_rsscache.MYD# D5 e* a7 R8 Q: s$ _6 x- K
-rw-rw---- 1 mysql mysql 1024 Jun 3 16:05 pre_forum_rsscache.MYI
4 l1 B) ~! `3 z" Z) x8 hSol:
j' s- o3 A4 p0 u7 a3 a私hpmyadmin ==SQL 銝隞:& E- k1 T# J7 n3 T; Q& E* j
- 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, H, D3 T! @, L7 e
隞賢停甇撣訾
, q6 v& ^' ?) u; A& h憿: 嗡蝙皂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)* Z' Z% \1 T! ~5 x3 T9 _1 s( n
Sol: open_files_limit(default=962) 憭芸,寧4096,望澆撅祆廝ead-only,/etc/my.cnf
& a' V5 K/ X [嗅 service mariadb restart6 \8 ^. R) T3 G Q
9 E- E& o1 _" k: E1 r( x- p
[璇隞嗅臬榜
4 o( B) t# e; N" X, q; l5 e# @mysqldump -u撣唾 -p撖蝣 -h銝餅 鞈摨 鞈銵 -w "sql璇隞" > 箄撓頝臬瑼獢 I. E; R" d* O. d% m5 o
靘:
. P N5 W! v0 H8 ~, h+ G! kmysqldump -uroot -p123456 -hlocalhost -e AREA_UTF8 city -w "c_id<10 " > /home/web/a.txt
$ D9 I. B9 T! ]7 J" D/ | / X3 k; H8 j: | I* n! a
--no-create-info嚗-t/ H0 t/ M$ f" B" D
芸箄嚗銝瘛餃 CREATE TABLE 隤伐憒撠箸澆搴QL隤伐芣insert into典6 \1 _2 o0 C; u7 f3 \0 o/ S' [0 }
--no-data嚗-d
1 Z( L6 S h* `8 d銝撠箔遙雿鞈嚗芸箄摨怎瑽
! G' v4 a8 m1 v7 u( v$ E1 M--quick嚗-q 4 q4 j d) u$ j& O/ F
典箏之鞈敺剁撘瑕嗅 MySQL Server 亥岷敺閮湔亥撓綽銝臬敺閮敺摮刻園銝准
1 X! |: o$ Z$ b& _) A9 z; |, t+ e* }& `( \" ~6 Q
' B! Q! a1 N7 f[臬包
3 M2 c; A6 t% x! h/ b8 Hmysql -u userid -p [-h localhost] db_Name < xxxxx.sql9 O4 r. [" s& H' Z
臬交鞈摨: mysql -u userid -p < all-database.sql
- V8 L) A; k/ h3 {) |臬乩table :
: k4 u" _. R2 ~" `* cmysql -u userid -p -D dbname < cc5278_dzx20.ip2c.201506242307.sql0 A% z( |# `8 w. ]% G7 q) y/ [7 Y6 x- v
P.S憒臬交憭芸之憒7GB,臬交獢銋瑁銝隞:$ a$ n6 T$ T6 E; k- c
mysql -uroot -p -e "set global net_buffer_length=1000000; set global max_allowed_packet=1000000000;"7 \% N6 u& e4 ~ @& t. @
; K# P/ B9 \3 r+ c[臬箏蝡喳臬亙啣虫唬蜓璈]1 ~" u; ]' _7 d; F1 Y& G
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
, o2 t. G& A( l8 V4 ~- F[閮剖臬乩(批2Mb) by phpmyadmin]9 _: j8 ~' F" \9 |
http://www.av4u.info/forum.php?m ... e=1&extra=#pid20348
4 ]9 G0 Y" y& W; o
7 A1 x) R7 D; K- N/ x
- q$ T; R1 o; ^6 s3 |$ n% j; E5 [7 K& {' M
7 P+ j* N1 F( v
# e: L& V( L+ l1 O* ?. \7 n: n; P* A3 J: {; A/ _' L, b
, ^4 [$ U% |% q7 a5 N2 r( I# f$ ~6 U& e. E* z/ U; f$ o6 V) i( Q6 W: J9 M
4 y: @. `1 S' n8 S
- D" f; X/ _- U# e/ ?: r G- s0 h& N* j8 K4 U; p2 C5 b
+ [1 Q5 ?3 `6 T" `& t1 N9 j3 [% \
) |" U, R ` I" [5 v; M+ I8 ?! w6 B9 h; V* ?+ x; y
|
|