[臬榜0 G' I) k/ j$ q- x- }$ N
mysqldump -u userid -e -p db_Name > xxxxx.sql4 t! e _1 Q5 c9 k! X" p% n
臬箔table:mysqldump -p -u userid dbname tablename > 52avtv_dzx20.201506242307.sql
0 G6 l2 V5 ? R" E! b* t; N0 R臬箸鞈摨: mysqldump -p -u userid --all-databases > all-database.sql . D% r- w3 q) J4 A6 R$ Z
雿,臬啁桃鞈摨怎雿輻刻撣唾撖蝣潭憿,隞仿舀鞈摨怠交,雿輻刻撣唾銋亙臬箸頛摰
2 E; d1 u; x; {[芸臬箇瑽] : https://iter01.com/206843.html8 B2 P T9 r1 ]- Z0 I6 V
mysqldump--opt-d鞈摨怠-uroot-p>xxx.sql ]- n6 h X& f1 ~7 o
[芸臬箄]% _0 I v* i( T$ M6 \" Q
mysqldump-t鞈摨怠-uroot-p>xxx.sql# Q. K" `* ^6 l) m- O# [ t8 |
; Y! o2 }; `9 p# Y( b" ^. `
瘜冽: 嗡誑銝餈唳隞文隞賣蝬脩箇 "502 bad gateway",敶梢踹迸ginx,芾 --single-transaction --quick 撠勗末鈭,憒銝:7 H8 v {/ O1 Y7 ]! c% E0 ^
mysqldump -u userid -e -p --single-transaction --quick db_Name > xxxxx.sql" a/ G4 B6 Z8 d
憿:mysqldump: Got error: 1017: Can't find file: 'pre_forum_rsscache' (errno: 2) when using LOCK TABLES
& r: D) D2 u; j: Q3 USol: 芾皂ysqldump銝--lock-tables=false撠勗臭誑閫瘙箏憿
! C7 t4 |: U7 O. R: V; J. O% z亥箇: 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/ v* K% O8 P1 B+ R, g
-rw-rw---- 1 mysql mysql 8852 Jun 3 16:05 pre_forum_rsscache.frm
3 T/ x" a- g; `, s+ s-rw-rw---- 1 mysql mysql 0 Jun 3 16:05 pre_forum_rsscache.MYD
' q8 c/ {3 M, d. z9 r-rw-rw---- 1 mysql mysql 1024 Jun 3 16:05 pre_forum_rsscache.MYI5 t, E" T& x( x! s3 G' d% {0 J
Sol: . s }5 M7 w% S' M: r7 ?
私hpmyadmin ==SQL 銝隞:* g' |, K8 V B
- 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
銴鋆賭誨蝣
* A2 Z+ h' ^9 }/ D# `1 a隞賢停甇撣訾$ {' M A! F" i4 R' M
憿: 嗡蝙皂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)6 g! S" w. _ e9 v% Q
Sol: open_files_limit(default=962) 憭芸,寧4096,望澆撅祆廝ead-only,/etc/my.cnf
; d/ C- o+ q1 C: u) z; J" p' \" V嗅 service mariadb restart
2 o" H, I( B7 B8 \& {4 h' S" c% X. n. M$ ]/ h8 [' q o- h3 N7 K
[璇隞嗅臬榜
i" }3 W H) W8 Smysqldump -u撣唾 -p撖蝣 -h銝餅 鞈摨 鞈銵 -w "sql璇隞" > 箄撓頝臬瑼獢/ @7 Y! A$ Z2 Q9 j) k4 ^. d
靘:
' S7 B9 p3 ^+ k1 k& Q8 m+ Y' l; ]# fmysqldump -uroot -p123456 -hlocalhost -e AREA_UTF8 city -w "c_id<10 " > /home/web/a.txt6 S( K' `% h1 F
+ n7 P4 Q4 X: E2 N# w9 ?' `
--no-create-info嚗-t
+ T% J0 z, H7 Y. L芸箄嚗銝瘛餃 CREATE TABLE 隤伐憒撠箸澆搴QL隤伐芣insert into典( {' t" z. Y+ Y0 S$ ^
--no-data嚗-d5 B, E- U3 h! ` M( e
銝撠箔遙雿鞈嚗芸箄摨怎瑽
# G$ f3 |9 L2 F$ y" q--quick嚗-q 7 l6 X6 f2 p. c2 j
典箏之鞈敺剁撘瑕嗅 MySQL Server 亥岷敺閮湔亥撓綽銝臬敺閮敺摮刻園銝准
A! x# ?' f6 S H7 u5 r h* O: l: {3 Q: Q; M6 ?
0 S2 `8 o! R2 O! d' f) E
[臬包
' p3 E8 u( @4 N& Wmysql -u userid -p [-h localhost] db_Name < xxxxx.sql
: C( \2 M4 ]* H; n4 B0 g臬交鞈摨: mysql -u userid -p < all-database.sql5 E6 v! E% J, Q
臬乩table :
* v+ O3 c, G! ]+ Lmysql -u userid -p -D dbname < cc5278_dzx20.ip2c.201506242307.sql
, Y, e: \" e8 N2 PP.S憒臬交憭芸之憒7GB,臬交獢銋瑁銝隞:7 S" B5 X! w" V$ `4 `0 ~1 t
mysql -uroot -p -e "set global net_buffer_length=1000000; set global max_allowed_packet=1000000000;"
5 l/ W4 U4 T, V" t/ R' r: e6 S+ y4 x, ~4 B% y
[臬箏蝡喳臬亙啣虫唬蜓璈]
" b1 o# O: Z' _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 2 b" }; C. N+ u
[閮剖臬乩(批2Mb) by phpmyadmin]3 n$ f `7 h7 W4 k+ q' E
http://www.av4u.info/forum.php?m ... e=1&extra=#pid20348
. P7 N* A" q/ W4 G, B* G- q: J; v+ s* K
4 V, | R$ W! z8 w
0 W" g9 }# ]* N+ m: H) }
4 y5 {7 E3 a4 B5 X' J- e2 {0 N9 W6 g6 v
/ }: z7 d6 z( g [; K/ `. ]2 Q* o; x! J% @
* ~; [$ T# F5 D9 n7 Q
. s: k/ G+ a" m$ `- v& w9 H0 H4 D2 q+ O- T- @3 ^+ D5 ^
- C ~1 m2 s0 r$ t' d* A1 U& f4 |
! P3 w9 v! b2 o
1 T( ^' d; J8 Y2 p) P' t7 Z7 K
- ?. q2 q5 k7 a0 o
: w3 j1 j) j# e! i8 Q |
|