[臬榜* d9 R! h7 e9 D. K
mysqldump -u userid -e -p db_Name > xxxxx.sql2 F; A$ E8 r8 E; N
臬箔table:mysqldump -p -u userid dbname tablename > 52avtv_dzx20.201506242307.sql
( J0 p" n M( Z5 m F8 N0 Y" G臬箸鞈摨: mysqldump -p -u userid --all-databases > all-database.sql
% I2 B/ \! U. u* G* }6 S 雿,臬啁桃鞈摨怎雿輻刻撣唾撖蝣潭憿,隞仿舀鞈摨怠交,雿輻刻撣唾銋亙臬箸頛摰
% t; a: E; L7 E, C[芸臬箇瑽] : https://iter01.com/206843.html# C7 |+ I5 R7 V3 S8 }
mysqldump--opt-d鞈摨怠-uroot-p>xxx.sql; f' G2 `0 L/ `! E6 K/ R9 o4 N
[芸臬箄]
, v4 I, m3 G6 d( A5 l: mmysqldump-t鞈摨怠-uroot-p>xxx.sql9 K$ t6 G" i" ~/ Z$ p! \, ]
4 z; t/ ~1 E% Z2 e( F9 j瘜冽: 嗡誑銝餈唳隞文隞賣蝬脩箇 "502 bad gateway",敶梢踹迸ginx,芾 --single-transaction --quick 撠勗末鈭,憒銝:
- y) o; N* E7 p2 U. O# U/ H, U/ Pmysqldump -u userid -e -p --single-transaction --quick db_Name > xxxxx.sql
- ~# y1 m4 p% j憿:mysqldump: Got error: 1017: Can't find file: 'pre_forum_rsscache' (errno: 2) when using LOCK TABLES
, X" O' U' n! T7 b7 J, DSol: 芾皂ysqldump銝--lock-tables=false撠勗臭誑閫瘙箏憿2 G1 z/ K: O- C/ }
亥箇: 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瑼:3 D* Y2 j/ r# m+ @! q- l
-rw-rw---- 1 mysql mysql 8852 Jun 3 16:05 pre_forum_rsscache.frm7 n9 N4 H8 t' R' Z2 M. j, b
-rw-rw---- 1 mysql mysql 0 Jun 3 16:05 pre_forum_rsscache.MYD; Q2 R8 ~: \1 u" B5 s; g
-rw-rw---- 1 mysql mysql 1024 Jun 3 16:05 pre_forum_rsscache.MYI
' w8 Q+ l0 q3 {. J0 |( o; KSol:
* Z6 _9 x& g6 `私hpmyadmin ==SQL 銝隞:
J6 | D* c$ @( _: s0 X' g& P- 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
銴鋆賭誨蝣 ( Z% Q$ b9 X5 n+ B1 F; Z
隞賢停甇撣訾' S& ]9 k4 J9 M% W% a. b4 H9 _
憿: 嗡蝙皂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)1 |+ x8 l F S% E8 {, S9 ~' Q6 j" [
Sol: open_files_limit(default=962) 憭芸,寧4096,望澆撅祆廝ead-only,/etc/my.cnf + n& Z4 Y9 g1 D9 y9 H
嗅 service mariadb restart
5 T- |6 E$ z' w" f {
; J( M, b" `3 K& e$ p" H2 h[璇隞嗅臬榜! ]$ j+ ?( n4 a
mysqldump -u撣唾 -p撖蝣 -h銝餅 鞈摨 鞈銵 -w "sql璇隞" > 箄撓頝臬瑼獢$ m' r9 N6 H; `& j% [" ]* R" G
靘:
0 a4 b; p2 ^7 S- J2 ~$ [3 vmysqldump -uroot -p123456 -hlocalhost -e AREA_UTF8 city -w "c_id<10 " > /home/web/a.txt& U v5 L; E; O
" g1 |( `# ?, Y0 h+ Q
--no-create-info嚗-t
& Q+ l( q) {0 V: k芸箄嚗銝瘛餃 CREATE TABLE 隤伐憒撠箸澆搴QL隤伐芣insert into典4 p3 [1 q$ j( G9 |9 O
--no-data嚗-d
0 n- R1 B9 H/ N5 O銝撠箔遙雿鞈嚗芸箄摨怎瑽
0 q( q4 J2 ?; ? d* f. h--quick嚗-q
. m5 Z' k& W- c4 R典箏之鞈敺剁撘瑕嗅 MySQL Server 亥岷敺閮湔亥撓綽銝臬敺閮敺摮刻園銝准/ P! y" W- b2 m3 | i2 Y4 [8 f
* D6 R' H! i% M. J% o, \9 |! ^: m
4 Z5 J* Z5 n% J' {% \' M[臬包7 T Z' c$ K5 _# N6 @3 ^4 a. f8 b
mysql -u userid -p [-h localhost] db_Name < xxxxx.sql
1 V4 |. T# H/ c臬交鞈摨: mysql -u userid -p < all-database.sql
8 s% X' c9 q9 |9 Q臬乩table :+ n$ P6 U' H9 H9 O2 i, p
mysql -u userid -p -D dbname < cc5278_dzx20.ip2c.201506242307.sql4 D2 `' t* K8 ]8 Q
P.S憒臬交憭芸之憒7GB,臬交獢銋瑁銝隞:
0 |/ X' c, Q/ k# ~( n8 Ymysql -uroot -p -e "set global net_buffer_length=1000000; set global max_allowed_packet=1000000000;"
; K7 z* a3 R' |& E9 m+ s# ?% o
; w: _" T4 i) N5 w" i' g; ?' I[臬箏蝡喳臬亙啣虫唬蜓璈]
Z# {3 @3 d7 p V* Rmysqldump -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
; ~1 |" h; d, o" R* o+ l- F$ D[閮剖臬乩(批2Mb) by phpmyadmin]
1 H0 j, }$ H" ^6 Whttp://www.av4u.info/forum.php?m ... e=1&extra=#pid20348* C z- w8 p! X9 A0 S
9 M O" V% d: |5 l4 g6 `
1 F8 u7 Q. P6 D/ A/ v; _
1 k, z6 }1 h% {5 y# U d! T- E& v; B* V6 p
. F! v0 U5 d( W# y$ r, L/ Z
. f' V2 A2 m6 v1 [
: n# f9 s, g% d) u$ h* E* Z# J0 |
+ S% O" |# c' \9 J
}4 h ^! \: p# a: w3 j
: S9 w- K/ e8 e5 _& ~
& J9 g. A: c9 {* Z8 }
7 \/ ^( v. q# C; `# E8 }* O+ ^0 q7 _( Z2 J& W" C1 P
|
|