BMS-HOSxP Community
HOSxP => MySQL => ข้อความที่เริ่มโดย: มนตรี บอยรักยุ้ยคนเดียว ที่ สิงหาคม 14, 2009, 08:41:15 AM
-
ทดสอบระบบ mysql 5.4.1 percona
ผมทำการทดสอบแล้ว
ลง Cent OS 5.3 +MySQL 5.1.30 percona ระดับที่ให้ 3
ลง Cent OS 4.7 +MySQL 5.1.30 percona ระดับที่ให้ 4
ลง Cent OS 4.7 +MySQL 5.1.37 percona ระดับที่ให้ 4
ลง Cent OS 5.3 +MySQL 5.1.37 percona ระดับที่ให้ 3
ลง Cent OS 5.3 +MySQL 5.4.1 percona ระดับที่ให้ 3
ลง Cent OS 5.3 +MySQL 5.4.1 ระดับที่ให้ 2
ลง Cent OS 4.7 +MySQL 5.1.37 ระดับที่ให้ 2
ลง Cent OS 5.3 +MySQL 5.1.37 ระดับที่ให้ 1
ดูจากการนำเข้าข้อมูล จากเครื่องหลักมาที่เครื่องสำรอง ระดับที่ให้เลขมากยิ่งใช้เวลาน้อย
ผมเหลือ ทดสอบ
ลง Cent OS 4.7 +MySQL 5.4.1 percona น่าจะเร็วมากเลย
MySQL percona แนะนำให้ใช้เป็น Innodb จะเห็นความแตกต่างที่มากกว่า
ใครต้องการ my.cnf สำหรับ MySQL 5.4.1 percona ส่ง email มา
เพราะใช้กับ MySQL 5.1.xx percona ไม่ได้ นะครับ
แนะนำแรม 4 GB ขึ้นไป นะครับ
-
tanoy999@yahoo.co.th
tanoy999@hotmail.com
;D ;D ;D ;D ;D
-
jassada.pai@gmail.com
-
wiratseenuan@gmail.com
-
chinaga13@hotmail.com
ขอ ram 8 G, 20 G,4 G ,2 G ,6 G
-
ยังมีปัญหาที่ soundex
ห้ามใช้ soundex
chinaga13@hotmail.com
ขอ ram 8 G, 20 G,4 G ,2 G ,6 G
แรม 6 G,20 G ต้องรอ สัก 1-2 วัน
แรม 2 G ขอไม่ทำแจก
ram 8 G, 4 G รอช่วงเย็น
-
:Dadisaksri@hotmail.com :D
-
my.cnf 8 Gb
ทดสอบผ่านแล้ว
-
my.cnf 4 Gb
-
my.cnf 16 G
-
my.cnf 6 G 20 G
-
ขอบคุณมากครับทดสอบได้ผลอย่างไรจะแจ้งให้ทราบครับ
-
thank you ว่าแต่4Gนี่ test ยังอะ ???
-
thank you ว่าแต่4Gนี่ test ยังอะ ???
ทดสอบแรม 2,4,8,10,16,32
แรมที่ไม่ได้ทดสอบ 6,20 ทดสอบแล้วมีปัญหาช่วยโพสท์ ด้วยนะครับ
ถ้าจะใช้แรม 2 Gb แนะนำให้ใช้ Cent OS 4.7 server CD + MySQL 5.1.30-2 or 5.1.37-7 percona
แบบ text mode จะเร็วมากเลย ทดสอบฐานขนาด 10 G
เร็วกว่า Cent OS 5.3 + MySQL 5.4.1 percona แรม 8 G ถึง 50 %
เร็วกว่า Cent OS 4.7 + MySQL 5.4.1 แรม 8 G ถึง 25 %
แต่ถ้าเริ่มเล่น linux ก็ลงแบบ Graphic Mode ง่ายกว่าแต่ช้ากว่า ได้อย่างเสียอย่าง
งานต่อไป Falcon กำลังดู my.cnf อยู่
falcon_serial_log_buffers= ???
falcon_disable_fsync= ???
falcon_min_record_memory= ???
falcon_record_memory_max = ???
falcon_page_cache_size = ???
falcon_page_size = ???
แนะนำการลง mysql แบบ XtraDB+percona ง่ายๆ
ใช้ 5 ไฟล์ ;D ;D ;D ;D ;D
1.MySQL-client-percona-5.1.37-6.rhel5.x86_64.rpm
2.MySQL-shared-percona-5.1.37-6.rhel5.x86_64.rpm
3.MySQL-server-percona-5.1.37-6.rhel5.x86_64.rpm
http://www.percona.com/mysql/TESTING/5.1.37-6/RPM/rhel5/MySQL-client-percona-5.1.37-6.rhel5.x86_64.rpm
http://www.percona.com/mysql/TESTING/5.1.37-6/RPM/rhel5/MySQL-shared-percona-5.1.37-6.rhel5.x86_64.rpm
http://www.percona.com/mysql/TESTING/5.1.37-6/RPM/rhel5/MySQL-server-percona-5.1.37-6.rhel5.x86_64.rpm
XtraDB
4.Percona-XtraDB-1.0.3-6-5.1.37-6.rhel5.x86_64.rpm
http://www.percona.com/mysql/TESTING/5.1.37-6/RPM/rhel5/Percona-XtraDB-1.0.3-6-5.1.37-6.rhel5.x86_64.rpm
xtraback
5.xtrabackup-0.8-1rc-1.rhel5.x86_64.rpm
http://www.percona.com/mysql/TESTING/xtrabackup-0.8.1rc/RPM/rhel5/xtrabackup-0.8.1rc-1.rhel5.x86_64.rpm
ขั้นตอนการลง mysql ใหม่
;D ;D ;D ;D ;D
ลองเขียนดูเพื่อน้องๆต้องการนำไปใช้
ผิด ถูกประการใดขอคำแนะนำด้วยนะครับมือใหม่หัดทำ linux
;D ;D
-
ขั้นตอนการลง mysql แบบ up
ขอให้ทุกคนโชคดีนะครับ
-
get_serialnumber
begin declare serial_exist int;
declare xserial_no int;
if param1='' then select 'test' into param1;
end if;
select count(serial_no) into serial_exist from serial where name = param1;
if serial_exist = 0 then insert into serial (name,serial_no) values (param1,0);
end if;
update serial set serial_no = serial_no + 1 where name = param1;
select serial_no into xserial_no from serial where name = param1;
return xserial_no;
end
param1 varchar(150)
int(11)
ิ
-
arsan_2005@hotmail.com
-
ขั้นตอนการลง mysql แบบ up
ให้ใช้คำสั่ง
rpm -qa | grep -i '^mysql-'
เพื่อแสดง Package ของ MySQL ที่เคยติดตั้งไปแล้ว
ทำการ remove mysql package เฉพาะ server เท่านั้น
ให้ใช้คำสั่ง
rpm --nodeps -ev MySQL-server-5.1.30-0.glib23
1.service mysql stop
2..export TMP=/tmp
3.export TMPDIR=/tmp
4.rm -fr /var/lib/mysql
5.rm -f /etc/init.d/mysql*
6.cp my.cnf /etc/my.cnf
7.chmod 744 /etc/my.cnf
8.echo 'root soft nofile 30000' >> /etc/security/limits.conf
9.echo 'root hard nofile 30000' >> /etc/security/limits.conf
10.echo 'mysql soft nofile 30000' >> /etc/security/limits.conf
11.echo 'mysql hard nofile 30000' >> /etc/security/limits.conf
11.1 mysql_upgrade
12.rpm -Uvh MySQL-client-percona-5.1.37-6.rhel5.x86_64.rpm --nodeps --force
13.rpm -Uvh MySQL-shared-percona-5.1.37-6.rhel5.x86_64.rpm --nodeps --force
14.rpm -Uvh MySQL-server-percona-5.1.37-6.rhel5.x86_64.rpm --nodeps --force
15.rpm -ivh Percona-XtraDB-1.0.3-6-5.1.37-6.rhel5.x86_64.rpm --nodeps --force
16.rpm -ivh xtrabackup-0.8-1rc-1.rhel5.x86_64.rpm --nodeps --force
17.service mysql stop
18.echo 'ulimit -n 30000' >> /etc/init.d/mysql
19.service mysql start
20.mysql -e "create database hos"
21.mysql -e "grant all privileges on hos.* to sa@'%' identified by 'sa'"
22.mysql -e "grant all privileges on *.* to sa@'%' identified by 'sa' with grant option"
23.echo 'ulimit -n 30000' >> /etc/rc.conf
ขอให้ทุกคนโชคดีนะครับ
อ.ครับ ลงแบบ upgrade โดยที่ไม่ต้อง ลบฐานข้อมูล ได้หรือเปล่าครับ ???
-
อ.ครับ ลงแบบ upgrade โดยที่ไม่ต้อง ลบฐานข้อมูล ได้หรือเปล่าครับ ???
ไม่แนะนำครับ เคยเจอปัญหากับตนเอง
เลยไม่กล้าสอนแบบไม่ลบฐานข้อมูล
แต่ใช้แบบย้ายฐานแบบ innobackup ก็ดีนะครับ
-
innobackup แบบไหนครับ อ. ??? เพราะว่าตอนนี้ master ของผม เป็น Mysql 5.1.30 64bit แต่การทำผมจะนำข้อมูลมาเข้า slave จากการทำ Initial Import ฐานข้อมูลมาไม่หมดครับ หายไป 4-5 G เลยครับ ซึ่งคิดว่ามันหายไปมากเกินไปครับ อ.mn ก็แนะนำให้ใช้การ backup จาก xtrabackup ซึ่งต้องเปลี่ยนมาเป็น Mysql percona, Xtradb ถูกต้องไหมครับ อ. ข้อมูลถึงจะ dump ได้หมดน่ะครับ ???
อ.มีข้อแนะนำบ้างไหมครับ ขอบคุณครับ ;D ;D ;D
-
innobackup แบบไหนครับ อ. ??? เพราะว่าตอนนี้ master ของผม เป็น Mysql 5.1.30 64bit แต่การทำผมจะนำข้อมูลมาเข้า slave จากการทำ Initial Import ฐานข้อมูลมาไม่หมดครับ หายไป 4-5 G เลยครับ ซึ่งคิดว่ามันหายไปมากเกินไปครับ อ.mn ก็แนะนำให้ใช้การ backup จาก xtrabackup ซึ่งต้องเปลี่ยนมาเป็น Mysql percona, Xtradb ถูกต้องไหมครับ อ. ข้อมูลถึงจะ dump ได้หมดน่ะครับ ???
อ.มีข้อแนะนำบ้างไหมครับ ขอบคุณครับ ;D ;D ;D
การ backup ของ percona-Xtradb มี 2 แบบ คือ
1.xtrabackup
2.innobackup
ของผมลองทดสอบ ฐาน 10 G หายไป 200 M
แต่ดูข้อมูลโดยร่วมครบนะครับ
;D ;D ;D ;D ;D
-
ของผม ฐานข้อมูล 36G ครับ หายไป 5G ไม่น่ายอมรับได้ครับ ก็เลยต้องหาวิธีทำให้ดีที่สุดให้ได้กลับมามากที่สุดครับ ??? ซึ่งปัจจุบันผมใช้ Mysql 5.1.30 64bit ธรรมดาๆ ครับ ??? ;D
-
1.ลอง cold backup ใช้เวลาเท่าไร
2.แตกข้อมูลที่เครื่องสำรองแล้วฐานโตเท่าไร
3.ผมไม่เคยลองฐานโตขนาดนั้น
4.ขอฐานมาทดสอบได้ไหมครับ (ขอแบบcold backup)
-
ผ่านไป 1 ชม.แล้วครับ เพิ่ม ได้แค่ 50% เองครับ(แบบ coolbackup) ตามที่ อ.บอกครับ :o ;D ;D ;D
-
สรุปกระบวนการเสร็จสรรพ ตั้งแต่เริ่ม จนจบเป็น 7z ใช้เวลาไป 5 ชม.ครับ ได้ฐานข้อมูลที่ เป็น .7z = 1.94GB ครับ :o ;D ;D ;D เดี๋ยวจะทดสอบ restore ต่อไปว่าจะได้ฐานข้อมูลกลับมาเท่าไรครับ ;D
-
ต้องใช้คำสั่ง backup ที่ server เลยครับ ของ รพ. ผม
-database 25 GB ใช้คำสั่ง backup ได้ hos.sql 13 GB พอ zip แล้ว ได้ hos.sql.gz 3 GB ครับ
แล้วค่อย ใช้ winscp copy จาก server มาเก็บไว้ ครับ ใช้เวลาไม่นาน ผมได้ post ภาพการติดตั้ง centos5.3+mysql5.1.33 มีอยู่แล้วครับ....ลองค้นหาดูนะครับ
-
ขอบคุณครับ อ.tanoy999 ผมจะลองทดสอบดูครับ ;D
จากที่ผมได้ทำ coldbackup แล้วนำกลับไป restore ใน slave ได้ขนาดฐานข้อมูลกลับมา 30G พอดิบพอดี ซึ่ง Master มีอยู่ประมาณ 37G จึงหายไป 7G ครับ :'(
เดี๋ยวจะลองแบบ อ.tanoy999 ดูครับ ;D ??? :D
-
http://hosxp.net/index.php?option=com_smf&Itemid=28&topic=9679.15
1.คำสั่งดังนี้ครับ เก็บข้อมูลสำรองไว้ที่ /var/backup >>>ชื่อ hos1.sql เพราะ /var มีพื้นที่ใหญ่สุด ตามที่กล่าวมา
#mysqldump --opt --default-character-set=tis620 --force --allow-keywords --single-transaction --ignore-table=hos.replicate_log -h 192.168.20.2 -u sa -psa hos > /var/backup/hos1.sql
ประยุกต์ทำเป็น bat file ครับ ตั้งชื่อ backup1.sh เก็บไฟล์ bat ไว้ที่ /home/ponlawat
#vi backup.sh
#!/bin/sh
mysqldump --opt --default-character-set=tis620 --force --allow-keywords --single-transaction --ignore-table=hos.replicate_log -h 192.168.20.2 -u sa -psa hos > /var/backup/hos1.sql
----สามารถทำได้หลายตัว เช่น backup1.sh - backup2.sh >>>>โดย แต่ละ bat ไฟล์ backup ตั้งชื่อ
เมื่อ backup เป็น hos1.sql , hos2.sql
2. ตั้งเงลา backup ครับ โดยใช้ crontab
คำสั่ง >>>>ที่ slave
#crontab -e
0 8 * * * sh /home/ponlawat/backup1.sh
######
ความหมาย คือ เวลา 8.00 น. ให้ รัน bat file backup1.sh ที่ /home/ponlawat/
ซึ่งใน bat file คือ
#!/bin/sh
mysqldump --opt --default-character-set=tis620 --force --allow-keywords --single-transaction --ignore-table=hos.replicate_log -h 192.168.20.2 -u sa -psa hos > /var/backup/hos1.sql
-
ตั้งเวลาดังนี้ก็ได้นะครับ ใน crontab
0 0 * * * sh /home/ponlawat/backup1.sh
30 0 * * * gzip -f /var/backup/hos1.sql
ความหมาย
- เวลา เที่ยงคืนตรง ทุกวัน ให้ทำการ backup hosxp ซึ่ง ทำ script แล้ว ชื่อไฟล์ backup1.sh
- ต่อมา เที่ยงคืนครึ่ง ให้ทำการ zip hos1.sql ครับ ต้องคำนวณ เวลาที่จะ backup ด้วยนะครับ เช่น 1 ชม. 2 ชม. แล้วแต่ ขนาด database ครับ
-
ลองเขียนแบบนี้
อ้างจาก อ.ตานอย 999
#vi backup.sh
#!/bin/sh
mysqldump --opt --default-character-set=tis620 --force --allow-keywords --single-transaction --ignore-table=hos.replicate_log -h 192.168.20.2 -u sa -psa hos > /var/backup/hos1.sql
gzip -f /var/backup/hos1.sql
จะได้เร็วขึ้นครับ ใช้เวลาฐาน 11 G ประมาณ 5 นาที
-
backup พร้อม zip ไปด้วย ใช่ไหมครับ ;D ;D ;D
-
backup พร้อม zip ไปด้วย ใช่ไหมครับ ;D ;D ;D
ใช่ครับ
พร้อมกันไปเลย เห็นจากน้องตานอย โพสต์ไว้เลยเก็บไปรวมกัน
แล้วทดสอบ ดีครับ ตารางครบครับ
หายไป 2 M น่าจะเป็นช่วงข้อมูลเปลี่ยนแปลง
-
#vi backup.sh
#!/bin/sh
mysqldump --opt --default-character-set=tis620 --force --allow-keywords --single-transaction --ignore-table=hos.replicate_log -h 192.168.20.2 -u sa -psa hos > /var/backup/hos1.sql
gzip -f /var/backup/hos1.sql
อ.ครับ ตรง table=hos.replicate_log -h หมายถึงตาราง replicate_log ตารางเดียวใช่เปล่าครับ ??? แล้วถ้าจะให้ สำรองทุกตาราง ต้องเขียนอย่างไรครับ ???
-
#!/bin/sh
mysqldump --opt --default-character-set=tis620 --force --allow-keywords --single-transaction --ignore-table=hos.replicate_log -h 192.168.20.2 -u sa -psa hos > /var/backup/hos1.sql
gzip -f /var/backup/hos1.sql
-อันนี้ไม่นี้ไม่ต้องการ tables replicate_log;
mysqldump --opt --default-character-set=tis620 --force --allow-keywords --single-transaction -h 192.168.20.2 -u sa -psa hos > /var/backup/hos1.sql
gzip -f /var/backup/hos1.sql
อันนี้ทั้งหมด
-
ทดสอบแรม 2,4,8,10,16,32
แรมที่ไม่ได้ทดสอบ 6,20 ทดสอบแล้วมีปัญหาช่วยโพสท์ ด้วยนะครับ
ถ้าจะใช้แรม 2 Gb แนะนำให้ใช้ Cent OS 4.7 server CD + MySQL 5.1.30-2 or 5.1.37-7 percona
แบบ text mode จะเร็วมากเลย ทดสอบฐานขนาด 10 G
เร็วกว่า Cent OS 5.3 + MySQL 5.4.1 percona แรม 8 G ถึง 50 %
เร็วกว่า Cent OS 4.7 + MySQL 5.4.1 แรม 8 G ถึง 25 %
แต่ถ้าเริ่มเล่น linux ก็ลงแบบ Graphic Mode ง่ายกว่าแต่ช้ากว่า ได้อย่างเสียอย่าง
------------------------------------------------------------------------------------------------
จากข้อความด้านบนของ พี่บอยครับ
ถ้าจะใช้แรม 2 Gb แนะนำให้ใช้ Cent OS 4.7 server CD + MySQL 5.1.30-2 or 5.1.37-7 percona
Cent OS 4.7 server CD ถ้าโหลดเป็น DVD จะต่างกันไหมครับ
ส่วนจากเว็บนี้ผมต้องโหลดตัวไหนครับ http://mirror.in.th/osarchive/centos/4.7/isos/i386/
พอดีว่าจะใช้OS linux เป็นเครื่อง server นะครับ
ตอนนี้กำลังลงเครื่องทดสอบอยู่ ครับ (ซึ่งช้ามากเลยครับแถมตอนนี้ยังติดตัวอักษรไทย เป็นเครื่องหมาย ???
พอมาเจอบทความพี่บอยเลยก่ะว่าจะลองดูครับ ช่วยแน่ะนำหน่อยนะครับ)
(เครื่องทดสอบ spec - cpu=intel รุุ่นอะไรไม่รู้แต่ 32bit แน่นอน ส่วนความเร็ว ก็ สอง กิก
- mainboard=asus p5vd2-vm
- ram=1Gbyte
- Os=Centos5.3(DVD)
- Mysql 5.1.37-gblic
)
ตอนนี้ Server จริงๆใช้ 2003 อยู่ครับ
-
http://mirror.in.th/osarchive/centos/4.7/isos/i386/CentOS-4.7.ServerCD-i386.iso
แนะนำลองก่อน
-
:D ขอบคุณครับพี่ จะเอาไปลองดูครับ
ขอ MySQL 5.1.30-2 or 5.1.37-7 percona ด้วยครับ
-
#!/bin/sh
mysqldump --opt --default-character-set=tis620 --force --allow-keywords --single-transaction --ignore-table=hos.replicate_log -h 192.168.20.2 -u sa -psa hos > /var/backup/hos1.sql
gzip -f /var/backup/hos1.sql
-อันนี้ไม่นี้ไม่ต้องการ tables replicate_log;
mysqldump --opt --default-character-set=tis620 --force --allow-keywords --single-transaction -h 192.168.20.2 -u sa -psa hos > /var/backup/hos1.sql
gzip -f /var/backup/hos1.sql
อันนี้ทั้งหมด
ของผมต้องใช้ว่า
mysqldump --opt --default-character-set=tis620 --force --allow-keywords --single-transaction --ignore-table=hos.*-h - u root -psa hos > /var/backup/hos1.sql
ได้มา 13G จาก 30G ครับ (ลองทำใน slave ดูก่อนครับ);D
-
falcon - test
my.cnf
cpu 4 core ram 8 G
maria- test
my.cnf
p4 ram 2 G
the next
;D ;D ;D ;D ;D ;D
;D ;D ;D ;D ;D ;D ;D ;D
-
#!/bin/sh
mysqldump --opt --default-character-set=tis620 --force --allow-keywords --single-transaction --ignore-table=hos.replicate_log -h 192.168.20.2 -u sa -psa hos > /var/backup/hos1.sql
gzip -f /var/backup/hos1.sql
-อันนี้ไม่นี้ไม่ต้องการ tables replicate_log;
mysqldump --opt --default-character-set=tis620 --force --allow-keywords --single-transaction -h 192.168.20.2 -u sa -psa hos > /var/backup/hos1.sql
gzip -f /var/backup/hos1.sql
อันนี้ทั้งหมด
ของผมต้องใช้ว่า
mysqldump --opt --default-character-set=tis620 --force --allow-keywords --single-transaction --ignore-table=hos.*-h - u root -psa hos > /var/backup/hos1.sql
ได้มา 13G จาก 30G ครับ (ลองทำใน slave ดูก่อนครับ);D
อ.ครับ ปัญหาคือจะทำกับ Master ไม่ได้ครับ hdd เหลือประมาณ 7% ครับ ไม่พอที่จะ backup แล้วครับ มีวิธี backup แล้วโยนไปไว้ที่เครื่องอื่นได้ไหมครับ ???
-
ดันครับ ;D
-
อ.ครับ ปัญหาคือจะทำกับ Master ไม่ได้ครับ hdd เหลือประมาณ 7% ครับ ไม่พอที่จะ backup แล้วครับ มีวิธี backup แล้วโยนไปไว้ที่เครื่องอื่นได้ไหมครับ ??? ;D ???
-
ลองอ่าน help ของ mysqldump ดูครับ
mysqldump Ver 10.13 Distrib 5.1.30, for Win32 (ia32)
By Igor Romanenko, Monty, Jani & Sinisa
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL license
Dumping definition and data mysql database or table
Usage: mysqldump [OPTIONS] database [tables]
OR mysqldump [OPTIONS] --databases [OPTIONS] DB1 [DB2 DB3...]
OR mysqldump [OPTIONS] --all-databases [OPTIONS]
Default options are read from the following files in the given order:
C:\Windows\my.ini C:\Windows\my.cnf C:\my.ini C:\my.cnf C:\Program Files\HOSxP\MySQL\my.ini C:\Program Files\HOSxP\MySQL\my.cnf
The following groups are read: mysqldump client
The following options may be given as the first argument:
--print-defaults Print the program argument list and exit
--no-defaults Don't read default options from any options file
--defaults-file=# Only read default options from the given file #
--defaults-extra-file=# Read this file after the global files are read
-a, --all Deprecated. Use --create-options instead.
-A, --all-databases Dump all the databases. This will be same as --databases
with all databases selected.
-Y, --all-tablespaces
Dump all the tablespaces.
-y, --no-tablespaces
Do not dump any tablespace information.
--add-drop-database Add a 'DROP DATABASE' before each create.
--add-drop-table Add a 'drop table' before each create.
--add-locks Add locks around insert statements.
--allow-keywords Allow creation of column names that are keywords.
--character-sets-dir=name
Directory where character sets are.
-i, --comments Write additional information.
--compatible=name Change the dump to be compatible with a given mode. By
default tables are dumped in a format optimized for
MySQL. Legal modes are: ansi, mysql323, mysql40,
postgresql, oracle, mssql, db2, maxdb, no_key_options,
no_table_options, no_field_options. One can use several
modes separated by commas. Note: Requires MySQL server
version 4.1.0 or higher. This option is ignored with
earlier server versions.
--compact Give less verbose output (useful for debugging). Disables
structure comments and header/footer constructs. Enables
options --skip-add-drop-table --no-set-names
--skip-disable-keys --skip-add-locks
-c, --complete-insert
Use complete insert statements.
-C, --compress Use compression in server/client protocol.
--create-options Include all MySQL specific create options.
-B, --databases To dump several databases. Note the difference in usage;
In this case no tables are given. All name arguments are
regarded as databasenames. 'USE db_name;' will be
included in the output.
-#, --debug[=#] This is a non-debug version. Catch this and exit
--debug-check Check memory and open file usage at exit.
--debug-info Print some debug info at exit.
--default-character-set=name
Set the default character set.
--delayed-insert Insert rows with INSERT DELAYED;
--delete-master-logs
Delete logs on master after backup. This automatically
enables --master-data.
-K, --disable-keys '/*!40000 ALTER TABLE tb_name DISABLE KEYS */; and
'/*!40000 ALTER TABLE tb_name ENABLE KEYS */; will be put
in the output.
-E, --events Dump events.
-e, --extended-insert
Allows utilization of the new, much faster INSERT syntax.
--fields-terminated-by=name
Fields in the textfile are terminated by ...
--fields-enclosed-by=name
Fields in the importfile are enclosed by ...
--fields-optionally-enclosed-by=name
Fields in the i.file are opt. enclosed by ...
--fields-escaped-by=name
Fields in the i.file are escaped by ...
-x, --first-slave Deprecated, renamed to --lock-all-tables.
-F, --flush-logs Flush logs file in server before starting dump. Note that
if you dump many databases at once (using the option
--databases= or --all-databases), the logs will be
flushed for each database dumped. The exception is when
using --lock-all-tables or --master-data: in this case
the logs will be flushed only once, corresponding to the
moment all tables are locked. So if you want your dump
and the log flush to happen at the same exact moment you
should use --lock-all-tables or --master-data with
--flush-logs
--flush-privileges Emit a FLUSH PRIVILEGES statement after dumping the mysql
database. This option should be used any time the dump
contains the mysql database and any other database that
depends on the data in the mysql database for proper
restore.
-f, --force Continue even if we get an sql-error.
-?, --help Display this help message and exit.
--hex-blob Dump binary strings (BINARY, VARBINARY, BLOB) in
hexadecimal format.
-h, --host=name Connect to host.
--ignore-table=name Do not dump the specified table. To specify more than one
table to ignore, use the directive multiple times, once
for each table. Each table must be specified with both
database and table names, e.g.
--ignore-table=database.table
--insert-ignore Insert rows with INSERT IGNORE.
--lines-terminated-by=name
Lines in the i.file are terminated by ...
-x, --lock-all-tables
Locks all tables across all databases. This is achieved
by taking a global read lock for the duration of the
whole dump. Automatically turns --single-transaction and
--lock-tables off.
-l, --lock-tables Lock all tables for read.
--log-error=name Append warnings and errors to given file.
--master-data[=#] This causes the binary log position and filename to be
appended to the output. If equal to 1, will print it as a
CHANGE MASTER command; if equal to 2, that command will
be prefixed with a comment symbol. This option will turn
--lock-all-tables on, unless --single-transaction is
specified too (in which case a global read lock is only
taken a short time at the beginning of the dump - don't
forget to read about --single-transaction below). In all
cases any action on logs will happen at the exact moment
of the dump.Option automatically turns --lock-tables off.
--max_allowed_packet=#
--net_buffer_length=#
--no-autocommit Wrap tables with autocommit/commit statements.
-n, --no-create-db 'CREATE DATABASE /*!32312 IF NOT EXISTS*/ db_name;' will
not be put in the output. The above line will be added
otherwise, if --databases or --all-databases option was
given.}.
-t, --no-create-info
Don't write table creation info.
-d, --no-data No row information.
-N, --no-set-names Deprecated. Use --skip-set-charset instead.
--opt Same as --add-drop-table, --add-locks, --create-options,
--quick, --extended-insert, --lock-tables, --set-charset,
and --disable-keys. Enabled by default, disable with
--skip-opt.
--order-by-primary Sorts each table's rows by primary key, or first unique
key, if such a key exists. Useful when dumping a MyISAM
table to be loaded into an InnoDB table, but will make
the dump itself take considerably longer.
-p, --password[=name]
Password to use when connecting to server. If password is
not given it's solicited on the tty.
-W, --pipe Use named pipes to connect to server.
-P, --port=# Port number to use for connection.
--protocol=name The protocol of connection (tcp,socket,pipe,memory).
-q, --quick Don't buffer query, dump directly to stdout.
-Q, --quote-names Quote table and column names with backticks (`).
--replace Use REPLACE INTO instead of INSERT INTO.
-r, --result-file=name
Direct output to a given file. This option should be used
in MSDOS, because it prevents new line '\n' from being
converted to '\r\n' (carriage return + line feed).
-R, --routines Dump stored routines (functions and procedures).
--set-charset Add 'SET NAMES default_character_set' to the output.
Enabled by default; suppress with --skip-set-charset.
-O, --set-variable=name
Change the value of a variable. Please note that this
option is deprecated; you can set variables directly with
--variable-name=value.
--shared-memory-base-name=name
Base name of shared memory.
--single-transaction
Creates a consistent snapshot by dumping all tables in a
single transaction. Works ONLY for tables stored in
storage engines which support multiversioning (currently
only InnoDB does); the dump is NOT guaranteed to be
consistent for other storage engines. While a
--single-transaction dump is in process, to ensure a
valid dump file (correct table contents and binary log
position), no other connection should use the following
statements: ALTER TABLE, DROP TABLE, RENAME TABLE,
TRUNCATE TABLE, as consistent snapshot is not isolated
from them. Option automatically turns off --lock-tables.
--dump-date Put a dump date to the end of the output.
--skip-opt Disable --opt. Disables --add-drop-table, --add-locks,
--create-options, --quick, --extended-insert,
--lock-tables, --set-charset, and --disable-keys.
-S, --socket=name Socket file to use for connection.
--ssl Enable SSL for connection (automatically enabled with
other flags). Disable with --skip-ssl.
--ssl-ca=name CA file in PEM format (check OpenSSL docs, implies
--ssl).
--ssl-capath=name CA directory (check OpenSSL docs, implies --ssl).
--ssl-cert=name X509 cert in PEM format (implies --ssl).
--ssl-cipher=name SSL cipher to use (implies --ssl).
--ssl-key=name X509 key in PEM format (implies --ssl).
--ssl-verify-server-cert
Verify server's "Common Name" in its cert against
hostname used when connecting. This option is disabled by
default.
-T, --tab=name Creates tab separated textfile for each table to given
path. (creates .sql and .txt files). NOTE: This only
works if mysqldump is run on the same machine as the
mysqld daemon.
--tables Overrides option --databases (-B).
--triggers Dump triggers for each dumped table
--tz-utc SET TIME_ZONE='+00:00' at top of dump to allow dumping of
TIMESTAMP data when a server has data in different time
zones or data is being moved between servers with
different time zones.
-u, --user=name User for login if not current user.
-v, --verbose Print info about the various stages.
-V, --version Output version information and exit.
-w, --where=name Dump only selected records; QUOTES mandatory!
-X, --xml Dump a database as well formed XML.
Variables (--variable-name=value)
and boolean options {FALSE|TRUE} Value (after reading options)
--------------------------------- -----------------------------
all TRUE
all-databases FALSE
all-tablespaces FALSE
no-tablespaces FALSE
add-drop-database FALSE
add-drop-table TRUE
add-locks TRUE
allow-keywords TRUE
character-sets-dir (No default value)
comments TRUE
compatible (No default value)
compact FALSE
complete-insert FALSE
compress FALSE
create-options TRUE
databases FALSE
debug-check FALSE
debug-info FALSE
default-character-set tis620
delayed-insert FALSE
delete-master-logs FALSE
disable-keys TRUE
events FALSE
extended-insert TRUE
fields-terminated-by (No default value)
fields-enclosed-by (No default value)
fields-optionally-enclosed-by (No default value)
fields-escaped-by (No default value)
first-slave FALSE
flush-logs FALSE
flush-privileges FALSE
force FALSE
hex-blob FALSE
host (No default value)
insert-ignore FALSE
lines-terminated-by (No default value)
lock-all-tables FALSE
lock-tables TRUE
log-error (No default value)
master-data 0
max_allowed_packet 16777216
net_buffer_length 1047551
no-autocommit FALSE
no-create-db FALSE
no-create-info FALSE
no-data FALSE
order-by-primary FALSE
port 0
quick TRUE
quote-names TRUE
replace FALSE
routines FALSE
set-charset TRUE
shared-memory-base-name (No default value)
single-transaction FALSE
dump-date TRUE
socket (No default value)
ssl FALSE
ssl-ca (No default value)
ssl-capath (No default value)
ssl-cert (No default value)
ssl-cipher (No default value)
ssl-key (No default value)
ssl-verify-server-cert FALSE
tab (No default value)
triggers TRUE
tz-utc TRUE
user (No default value)
verbose FALSE
where (No default value)
แต่ใน Linux ไม่ทราบว่ามี option ที่แตกต่างจากนี้หรือไม่
-
อ.ครับ ปัญหาคือจะทำกับ Master ไม่ได้ครับ hdd เหลือประมาณ 7% ครับ ไม่พอที่จะ backup แล้วครับ มีวิธี backup แล้วโยนไปไว้ที่เครื่องอื่นได้ไหมครับ ??? ;D ???
ต้องใช้ pipe เข้ามาช่วยครับ คือเป็นการ redirect out put ของโปรแกรมหนึ่งไปให้อีกโปรแกรมหนึ่งครับ ปกติ mysqldump หากพิมพ์เฉยๆ จะ print ผลที่ได้ออกหน้าจอ การใช้เครื่องหมาย > เป็นการบอกให้ redirect ไป save เป็น file แต่หากใช้เครื่องหมาย | (pipe) เข้ามาช่วยจะเป็นการ redirect ไปให้โปรแกรมอื่นได้ครับ โปรแกรมที่จะใช้ก็คือ mysql วิธีการนี้จะดีตรงที่ไม่มีการบันทึกข้อมูลเก็บเป็นแฟ้มเอาไว้ก่อน แต่ว่าจะใช้เวลานานกว่าครับ
ใช้คำสั่งคล้ายๆ แบบนี้ครับ (เปลี่ยน ip_server_a ให้เป็น IP ของ server ที่จะนำข้อมูลออกมา และเปลี่ยน ip_server_b เป็น IP ของเครื่อง server ที่จะส่งข้อมูลเข้าไปเก็บ)
mysqldump --opt --single-transaction -h ip_server_a -u xx -pxx | mysql -h ip_server_b -u xx -pxx
-
ใช้คำสั่งคล้ายๆ แบบนี้ครับ (เปลี่ยน ip_server_a ให้เป็น IP ของ server ที่จะนำข้อมูลออกมา และเปลี่ยน ip_server_b เป็น IP ของเครื่อง server ที่จะส่งข้อมูลเข้าไปเก็บ)
mysqldump --opt --single-transaction -h ip_server_a -u xx -pxx | mysql -h ip_server_b -u xx -pxx
คำสั่งไม่ครบครับ
แก้เป็น
mysqldump --opt --default-character-set=tis620 --force --allow-keywords --single-transaction -h ip_server_a -u sa -psa hos | mysql -h ip_server_b -u sa -psa hos
;D ;D
ใช้ได้ทั้งบน linux และ windows
ใช้เวลานานกว่าเดิม 6-8 เท่า นะครับ
-
ผมทดสอบกับฐานข้อมูล 29 GB
ทำได้ประมาณ 17 GB ใช้เวลาประมาณเกือบ 4 ชั่วโมง
แล้วก็มี error ดังนี้
----------------------------------------------------------
mysqldump: Couldn't execute 'show fields from `village_student_vaccine_list`': MySQL server has gone away (2006)
mysqldump: Couldn't execute 'show table status like 'village\_survey\_detail'': MySQL server has gone away (2006)
mysqldump: Couldn't execute 'SET OPTION SQL_QUOTE_SHOW_CREATE=1': MySQL server has gone away (2006)
mysqldump: Couldn't execute 'show fields from `village_survey_detail`': MySQL server has gone away (2006)
mysqldump: Couldn't execute 'show table status like 'village\_survey\_item'': MySQL server has gone away (2006)
mysqldump: Couldn't execute 'SET OPTION SQL_QUOTE_SHOW_CREATE=1': MySQL server has gone away (2006)
mysqldump: Couldn't execute 'show fields from `village_survey_item`': MySQL server has gone away (2006)
mysqldump: Couldn't execute 'show table status like 'village\_temple'': MySQL server has gone away (2006)
mysqldump: Couldn't execute 'SET OPTION SQL_QUOTE_SHOW_CREATE=1': MySQL server has gone away (2006)
mysqldump: Couldn't execute 'show fields from `village_temple`': MySQL server has gone away (2006)
mysqldump: Couldn't execute 'show table status like 'village\_temple\_type'': MySQL server has gone away (2006)
mysqldump: Couldn't execute 'SET OPTION SQL_QUOTE_SHOW_CREATE=1': MySQL server has gone away (2006)
mysqldump: Couldn't execute 'show fields from `village_temple_type`': MySQL server has gone away (2006)
mysqldump: Couldn't execute 'show table status like 'visit\_charge'': MySQL server has gone away (2006)
mysqldump: Couldn't execute 'SET OPTION SQL_QUOTE_SHOW_CREATE=1': MySQL server has gone away (2006)
mysqldump: Couldn't execute 'show fields from `visit_charge`': MySQL server has gone away (2006)
mysqldump: Couldn't execute 'show table status like 'visit\_name'': MySQL server has gone away (2006)
mysqldump: Couldn't execute 'SET OPTION SQL_QUOTE_SHOW_CREATE=1': MySQL server has gone away (2006)
mysqldump: Couldn't execute 'show fields from `visit_name`': MySQL server has gone away (2006)
mysqldump: Couldn't execute 'show table status like 'visit\_note'': MySQL server has gone away (2006)
mysqldump: Couldn't execute 'SET OPTION SQL_QUOTE_SHOW_CREATE=1': MySQL server has gone away (2006)
mysqldump: Couldn't execute 'show fields from `visit_note`': MySQL server has gone away (2006)
mysqldump: Couldn't execute 'show table status like 'visit\_note\_department'': MySQL server has gone away (2006)
mysqldump: Couldn't execute 'SET OPTION SQL_QUOTE_SHOW_CREATE=1': MySQL server has gone away (2006)
.
.
.
------------------------------------------------------------
น่าจะเป็น ที่มี lost connection หรือป่าวก็ไม่รู้ :(
-
ผมทดสอบกับฐานข้อมูล 29 GB
ทำได้ประมาณ 17 GB ใช้เวลาประมาณเกือบ 4 ชั่วโมง
แล้วก็มี error
น่าจะเป็น ที่มี lost connection หรือป่าวก็ไม่รู้ :(
ต้องขออภัย อ.อ๊อด ด้วยครับ
ไม่ได้บอกว่าทดสอบกับตัวไหน
ตามนี้ครับ
รันคำสั่งใน slave 1 --> FreeBSD 7.2, MySQL 5.1.30 (ซึ่งไม่ได้หยุดทำ replicate กับ Master)
dump ไปไว้ที่ slave 2 --> FreeBSD 7.2, MySQL 5.1.38
หรือเป็นที่ MySQL ต่างเวอร์ชันกันหว่า :( แย่จังลืมสนิทเลย ;)
-
ของผมก็เป็นเหมือนท่านเข้มเลยครับ ??? ทดสอบทำระหว่าง Mysql 5.1.30 64bit กับ Mysql 5.1.3032bit ครับ ;D
-
ผมทดสอบกับฐานข้อมูล 29 GB
ทำได้ประมาณ 17 GB ใช้เวลาประมาณเกือบ 4 ชั่วโมง
แล้วก็มี error
น่าจะเป็น ที่มี lost connection หรือป่าวก็ไม่รู้ :(
ต้องขออภัย อ.อ๊อด ด้วยครับ
ไม่ได้บอกว่าทดสอบกับตัวไหน
ตามนี้ครับ
รันคำสั่งใน slave 1 --> FreeBSD 7.2, MySQL 5.1.30 (ซึ่งไม่ได้หยุดทำ replicate กับ Master)
dump ไปไว้ที่ slave 2 --> FreeBSD 7.2, MySQL 5.1.38
หรือเป็นที่ MySQL ต่างเวอร์ชันกันหว่า :( แย่จังลืมสนิทเลย ;)
ผมไม่ใช่ อ.อ็อด ครับ
ของผมใช้
Server Master ------- Cent OS 4.7 +MySQL 5.1.30-2 Percona&XtraDB x 64 bit
Server Slave 1 ------- Cent OS 5.3 +MySQL 5.1.37-7 Percona&XtraDB x 64 bit
Server Slave 2 ------- Cent OS 5.3 +MySQL 5.4.1 Percona x 64 bit
Server Slave 3 ------- Ubantu 9.04 +MySQL 5.1.37-7 Percona&XtraDB x 64 bit
ไม่มีปัญหานี้ครับ
ผิดตรงไหนกันหรือเปล่า
-
ต้องขออภัย อ.อ๊อด ด้วยครับ
ผมพิมพ์ถูกแล้วครับ
แต่
ผมไม่ใช่ อ.อ็อด ครับ
เราคุยกันคนละเรื่องครับ ต้องขออภัย อ.บอย ด้วยครับ :P
ส่วนเรื่อง
ผิดตรงไหนกันหรือเปล่า
คงต้องกลับไปทดสอบกันใหม่ล่ะครับ ;D
-
SET OPTION SQL_QUOTE_SHOW_CREATE=1
นี้คือปัญหาของน้องครับ
http://bugs.mysql.com/bug.php?id=12719
-
SET OPTION SQL_QUOTE_SHOW_CREATE=1
นี้คือปัญหาของน้องครับ
http://bugs.mysql.com/bug.php?id=12719
ต้อง set ตรงไหนครับ อ. ;Dอิอิ ขอความรู้ด้วยครับ :o
-
;D วันนี้ผมลอง
mysqldump --opt --default-character-set=tis620 --force --allow-keywords --single-transaction -h ip_server_a -u sa -psa hos opitemrece | mysql -h ip_server_b -u sa -psa hos คือว่าจะ dump เฉพาะตารางน่ะครับ แต่ก็ยังติด error
mysqldujp: Error 2013: Lost connection to MySQL server during query when dumping table 'opitemrece' at row: 215927
แล้วก็หยุดครับ แก้ไขอย่างไรครับ ??? :'(
-
;D วันนี้ผมลอง
mysqldump --opt --default-character-set=tis620 --force --allow-keywords --single-transaction -h ip_server_a -u sa -psa hos opitemrece | mysql -h ip_server_b -u sa -psa hos คือว่าจะ dump เฉพาะตารางน่ะครับ แต่ก็ยังติด error
mysqldujp: Error 2013: Lost connection to MySQL server during query when dumping table 'opitemrece' at row: 215927
แล้วก็หยุดครับ แก้ไขอย่างไรครับ ??? :'(
ลองใช้ดู
mysqldump --opt --default-character-set=tis620 --force --allow-keywords --single-transaction -h ip_server_a -u sa -psa hos opitemrece | mysql -h ip_server_b -u sa -psa hos opitemrece
-
ไม่ได้ครับ อ. :'(
???[root@Slave3 ~]# mysqldump --opt --default-character-set=tis620 --force --allow-keyword
s --single-transaction -h 192.168.0.10 -u sa -psa hos opitemrece |mysql -h 192.168.0.5
-u sa -psa hos opitemrece
mysql Ver 14.14 Distrib 5.1.30, for pc-linux-gnu (i686) using readline 5.1
Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL license
Usage: mysql [OPTIONS] [database]
-?, --help Display this help and exit.
-I, --help Synonym for -?
--auto-rehash Enable automatic rehashing. One doesn't need to use
'rehash' to get table and field completion, but startup
and reconnecting may take a longer time. Disable with
--disable-auto-rehash.
-A, --no-auto-rehash
No automatic rehashing. One has to use 'rehash' to get
table and field completion. This gives a quicker start of
mysql and disables rehashing on reconnect. WARNING:
options deprecated; use --disable-auto-rehash instead.
-B, --batch Don't use history file. Disable interactive behavior.
(Enables --silent)
--character-sets-dir=name
Directory where character sets are.
--column-type-info Display column type information.
-c, --comments Preserve comments. Send comments to the server. The
default is --skip-comments (discard comments), enable
with --comments
-C, --compress Use compression in server/client protocol.
-#, --debug[=#] This is a non-debug version. Catch this and exit
--debug-check Check memory and open file usage at exit .
-T, --debug-info Print some debug info at exit.
-D, --database=name Database to use.
--default-character-set=name
Set the default character set.
--delimiter=name Delimiter to be used.
-e, --execute=name Execute command and quit. (Disables --force and history
file)
-E, --vertical Print the output of a query (rows) vertically.
-f, --force Continue even if we get an sql error.
-G, --named-commands
Enable named commands. Named commands mean this program's
internal commands; see mysql> help . When enabled, the
named commands can be used from any line of the query,
otherwise only from the first line, before an enter.
Disable with --disable-named-commands. This option is
disabled by default.
-g, --no-named-commands
Named commands are disabled. Use \* form only, or use
named commands only in the beginning of a line ending
with a semicolon (;) Since version 10.9 the client now
starts with this option ENABLED by default! Disable with
'-G'. Long format commands still work from the first
line. WARNING: option deprecated; use
--disable-named-commands instead.
-i, --ignore-spaces Ignore space after function names.
--local-infile Enable/disable LOAD DATA LOCAL INFILE.
-b, --no-beep Turn off beep on error.
-h, --host=name Connect to host.
-H, --html Produce HTML output.
-X, --xml Produce XML output
--line-numbers Write line numbers for errors.
-L, --skip-line-numbers
Don't write line number for errors. WARNING: -L is
deprecated, use long version of this option instead.
-n, --unbuffered Flush buffer after each query.
--column-names Write column names in results.
-N, --skip-column-names
Don't write column names in results. WARNING: -N is
deprecated, use long version of this options instead.
-O, --set-variable=name
Change the value of a variable. Please note that this
option is deprecated; you can set variables directly with
--variable-name=value.
--sigint-ignore Ignore SIGINT (CTRL-C)
-o, --one-database Only update the default database. This is useful for
skipping updates to other database in the update log.
--pager[=name] Pager to use to display results. If you don't supply an
option the default pager is taken from your ENV variable
PAGER. Valid pagers are less, more, cat [> filename],
etc. See interactive help (\h) also. This option does not
work in batch mode. Disable with --disable-pager. This
option is disabled by default.
--no-pager Disable pager and print to stdout. See interactive help
(\h) also. WARNING: option deprecated; use
--disable-pager instead.
-p, --password[=name]
Password to use when connecting to server. If password is
not given it's asked from the tty.
-P, --port=# Port number to use for connection or 0 for default to, in
order of preference, my.cnf, $MYSQL_TCP_PORT,
/etc/services, built-in default (3306).
--prompt=name Set the mysql prompt to this value.
--protocol=name The protocol of connection (tcp,socket,pipe,memory).
-q, --quick Don't cache result, print it row by row. This may slow
down the server if the output is suspended. Doesn't use
history file.
-r, --raw Write fields without conversion. Used with --batch.
--reconnect Reconnect if the connection is lost. Disable with
--disable-reconnect. This option is enabled by default.
-s, --silent Be more silent. Print results with a tab as separator,
each row on new line.
-S, --socket=name Socket file to use for connection.
-t, --table Output in table format.
--tee=name Append everything into outfile. See interactive help (\h)
also. Does not work in batch mode. Disable with
--disable-tee. This option is disabled by default.
--no-tee Disable outfile. See interactive help (\h) also. WARNING:
option deprecated; use --disable-tee instead
-u, --user=name User for login if not current user.
-U, --safe-updates Only allow UPDATE and DELETE that uses keys.
-U, --i-am-a-dummy Synonym for option --safe-updates, -U.
-v, --verbose Write more. (-v -v -v gives the table output format).
-V, --version Output version information and exit.
-w, --wait Wait and retry if connection is down.
--connect_timeout=# Number of seconds before connection timeout.
--max_allowed_packet=#
Max packet length to send to, or receive from server
--net_buffer_length=#
Buffer for TCP/IP and socket communication
--select_limit=# Automatic limit for SELECT when using --safe-updates
--max_join_size=# Automatic limit for rows in a join when using
--safe-updates
--secure-auth Refuse client connecting to server if it uses old
(pre-4.1.1) protocol
--server-arg=name Send embedded server this as a parameter.
--show-warnings Show warnings after every statement.
Default options are read from the following files in the given order:
/etc/mysql/my.cnf /etc/my.cnf ~/.my.cnf
The following groups are read: mysql client
The following options may be given as the first argument:
--print-defaults Print the program argument list and exit
--no-defaults Don't read default options from any options file
--defaults-file=# Only read default options from the given file #
--defaults-extra-file=# Read this file after the global files are read
Variables (--variable-name=value)
and boolean options {FALSE|TRUE} Value (after reading options)
--------------------------------- -----------------------------
auto-rehash FALSE
character-sets-dir (No default value)
column-type-info FALSE
comments FALSE
compress FALSE
debug-check FALSE
debug-info FALSE
database (No default value)
default-character-set tis620
delimiter ;
vertical FALSE
force FALSE
named-commands FALSE
local-infile FALSE
no-beep FALSE
host 192.168.0.5
html FALSE
xml FALSE
line-numbers TRUE
unbuffered FALSE
column-names TRUE
sigint-ignore FALSE
port 3306
prompt mysql>
quick FALSE
raw FALSE
reconnect FALSE
socket /var/lib/mysql/mysql.sock
table FALSE
user sa
safe-updates FALSE
i-am-a-dummy FALSE
connect_timeout 0
max_allowed_packet 16777216
net_buffer_length 16384
select_limit 1000
max_join_size 1000000
secure-auth FALSE
show-warnings FALSE
mysqldump: Got errno 32 on write
-
-D, --database=name Database to use.
-t, --table Output in table format.
-
mysqldump --opt --default-character-set=tis620 --force --allow-keywords --single-transaction --table=hos.opitemrece -h 192.168.0.10 -u sa -psa | mysql --table=hos.opitemrece -h 192.168.0.5 -u sa -psa
-
mysqldump --opt --default-character-set=tis620 --force --allow-keywords --single-transaction --table=hos.opitemrece -h 192.168.0.10 -u sa -psa | mysql --table=hos.opitemrece -h 192.168.0.5 -u sa -psa
mysqldump: option '--table' cannot take an argument ครับ ???
-
คือถ้าใช้
mysqldump --opt --default-character-set=tis620 --force --allow-keywords --single-transaction -h ip_server_a -u sa -psa hos an_stat | mysql -h ip_server_b -u sa -psa hos
ทำแล้วมาครบครับ แต่ตารางมันแค่ 133MB เองครับ แต่กับ opitemrece น่ะมัน 10GB ครับ ???
-
ขอ ดู my.cnf ที่เครื่องหลักทั้ง 2 เครื่อง
-
ตามนี้ครับ อ. ;D
server1 >my4GInnoDBnow
server2 >my4GXtraDBnow (ทดสอบ นำเข้าข้อมูลอยู่น่ะครับ) ???
-
ดันสักฮี้ด ครับ ;D
-
ตามนี้ครับ อ. ;D
server1 >my4GInnoDBnow
server2 >my4GXtraDBnow (ทดสอบ นำเข้าข้อมูลอยู่น่ะครับ) ???
แนะนำให้ใช้ แรม อย่างน้อย 8 Gb นะครับ
จะทำให้ง่ายขึ้น และดีกว่านี้ครับ
-
ขอบคุณครับ อ.บอย กำลังหาเงินซื้ออยู่ครับ เพราะว่า การเงินบอกว่าปิดงบไปแล้วครับ ??? เฮ้อ HDD ก็กำลังจะเต็มเหมือนกันครับ เหลืออีก 10% ของ 72G ครับ (ใช้มานานแล้วล่ะครับ set ก็ไม่ค่อยเก่งเลยครับ) ;D
-
ตามนี้ครับ อ. ;D
server1 >my4GInnoDBnow
server2 >my4GXtraDBnow (ทดสอบ นำเข้าข้อมูลอยู่น่ะครับ) ???
แนะนำให้ใช้ แรม อย่างน้อย 8 Gb นะครับ
จะทำให้ง่ายขึ้น และดีกว่านี้ครับ
สนับสนุน แรม 8 Gb ครับ
-
ตามนี้ครับ อ. ;D
server1 >my4GInnoDBnow
server2 >my4GXtraDBnow (ทดสอบ นำเข้าข้อมูลอยู่น่ะครับ) ???
แนะนำให้ใช้ แรม อย่างน้อย 8 Gb นะครับ
จะทำให้ง่ายขึ้น และดีกว่านี้ครับ
อิอิ แล้ว my.cnf ของผมเป็นอย่างไรบ้างครับ อ.
-
ก็ใช้ของผมนี้ครับ แต่เป็นตัวเก่า อิอิอิอิ
รพ.ที่มีคนไข้มากกว่าและใช้ข้อมูลมา 2-3 ปี
การค้นหาข้อมูลและการฐานข้อมูล จะมากกว่า รพ.ที่พึ่งขึ้นระบบครับ
การใช้งาน server จะมีมากกว่า 3-5 เท่า
เช่น การดึงรายงาน, 12 แฟ้ม,18 แฟ้ม,ยิ่งดึงเป็นปีงบนี่แหล่ะ คือบทพิสูจน์ server ครับ
ถ้าระบบเริ่มมีปัญหาเวลาดึงรายงานที่เป็นปีงบแล้ว เช่นอาการ ระบบทำงานช้าลง จนถึง ระบบล่ม
เตรียมทำใจขออนุมัติเพิ่มแรมเลยครับ
ผมใช้ประมาณนี้ครับเป็นตัวสังเกตุ เพราะ รพ.ผมมั่งจะมีการดึงรายงานตลอด
จนผมต้องแยกให้ดึงจากเครื่อง slave แต่บางทีผมเองที่ชอบดึงจาก master มากกว่า
พิสูจน์ว่าเราทำระบบได้แค่ไหน
-
ถูกแล้วครับ ผมใช้ของ อ.แหละครับ ;D ;D ;D
ช่วงนี้ เครื่อง hang บ่อยครับ เพราะมีการดึงรายงานกันเรื่อย(แรมกำลังขออนุัมัติซื้อครับ อยู่ในช่วงปิดงบพอดี)
เดิมผมก็ให้ดึงรายงานจาก slave แหละครับ แต่ผมทำ slave ใหม่แล้วข้อมูลยังไม่เท่ากันเลยครับ (ก็ยังทดลองนำเข้าอยู่เรื่อยๆ แต่ก็ยังใช้ไม่ได้สักที จึงต้องรบกวน อ.ในบอร์ด HOSxP อยู่เรื่อยเลยน่ะสิครับ ??? ;D :D
-
ถูกแล้วครับ ผมใช้ของ อ.แหละครับ ;D ;D ;D
ช่วงนี้ เครื่อง hang บ่อยครับ เพราะมีการดึงรายงานกันเรื่อย(แรมกำลังขออนุัมัติซื้อครับ อยู่ในช่วงปิดงบพอดี)
เดิมผมก็ให้ดึงรายงานจาก slave แหละครับ แต่ผมทำ slave ใหม่แล้วข้อมูลยังไม่เท่ากันเลยครับ (ก็ยังทดลองนำเข้าอยู่เรื่อยๆ แต่ก็ยังใช้ไม่ได้สักที จึงต้องรบกวน อ.ในบอร์ด HOSxP อยู่เรื่อยเลยน่ะสิครับ ??? ;D :D
ของท่านยอด ต้องเพิ่ม HD ด้วยนะครับเหลือน้อยแล้ว
ถ้าเครื่องหลักเป็นอะไรไปคง ปวดหัวและโดนเล่นงานแน่เลยครับ หรือจะขอที่เดียวเป็น 16~32~64 G น่าจะดีนะครับ จะเห็นระบบที่แตกต่างครับ
ตอนนี้ระบบของท่านยอดเหมือน เอารถกระบะ บรรทุกแข่งกับ สิบล้อ ระวังระบบจะล่มนะครับ
ระบบพอใช้
-แรม 8 G ต้องแยก server ดึงรายงาน อยู่ได้อีก 1-2 ปี
ระบบทีทำงานได้ง่ายขึ้น
-แรม 16 G กำลังดี อยู่ได้อีก 3-4 ปี คนใช้งานจะยิ้มมากขึ้น
-แรม 32 G ดีมากเลยครับ(ผมกำลังจะใช้ รอว่าจะซื้อที่ไหน ผอ.อนุมัติมา 2 เดือนแล้ว)
-
ขอบคุณ อ.ที่เป็นห่วงครับ ;D
ผมก็กลัวว่ามันจะล่มเหมือนกันครับ (ทุกวันนี้มันก็ hang วันละหลายๆ รอบแล้วล่ะครับ) ปวดหัวครับ ;D :'(
แรม ผมว่าจะซื้อที่ memorytoday.com น่ะครับ อิอิ ;D
-
ทดสอบระบบ Cent OS 5.3 +MySQL Percona 5.4.1 กับ สอ. 1 แห่ง CPU Quad 8200 Ram 4 Gb HD 320 วันที่ 15 กย. 2552 ครับ
Server ทำเสร็จแล้ว,ทดสอบแล้ว,อิอิอิอิอิ
-
ซู้ดยอด เอ้ย...สุดยอดเลยครับ ;D ;D ;D
-
สุดยอด .... ใช้ดีแล้วบอกต่อด้วยนะครับ ;D ;D ;D ;D ;D ;D
-
ถ้าหากว่าผม แปลงให้ตารางที่ใหญ่ อย่างเช่น opitemrece เป็น แบบ MyISAM แล้วค่อย mysqldump ได้หรือไม่ครับ (เฉพาะตารางที่มีขนาดใหญ่เท่านั้นน่ะครับ อ.) :'(
-
พี่ๆ ช่วยดู my.cnf ให้หน่อยครับผมลองปรับเอง แต่รู้สึกว่าใช้ไม่ค่อยดีเลย หรือไม่ก็ขอไฟล์ my.cnf
โดยผมลงเป็น centos 5.3 64 บิต MySQL 5.1.30-percona--64 bit แรม 2 gb ibm system x3200
ขอด่วนด้วยนะครับจะลองพรุ่งนี้เช้าเลย
-
;D ;D ;D ;D ;D
-
ถ้าหากว่าผม แปลงให้ตารางที่ใหญ่ อย่างเช่น opitemrece เป็น แบบ MyISAM แล้วค่อย mysqldump ได้หรือไม่ครับ (เฉพาะตารางที่มีขนาดใหญ่เท่านั้นน่ะครับ อ.) :'(
;D
-
ถ้าหากว่าผม แปลงให้ตารางที่ใหญ่ อย่างเช่น opitemrece เป็น แบบ MyISAM แล้วค่อย mysqldump ได้หรือไม่ครับ (เฉพาะตารางที่มีขนาดใหญ่เท่านั้นน่ะครับ อ.) :'(
ต้องลองทำดูครับ แต่ สำรองก่อนนะครับ