BMS-HOSxP Community
HOSxP => MySQL => ข้อความที่เริ่มโดย: dreaming ที่ กุมภาพันธ์ 23, 2010, 20:30:16 PM
-
1. ติดตั้ง MySQL ลงในเครื่่องที่จะทำหน้าที่เป็น Slave
2. เปิด configuration file ของ mysql มาแก้ไข หากใช้ linux จะอยู่ที่ /etc/my.cnf หรือหากใช้ Windows จะอยู่ที่ c:\windows\my.ini
3 ในเครื่องที่ทำหน้าที่เป็น Master ให้เพิ่ม ตรง section [mysqld] ดังนี้ครับ
server-id=1
log-bin
sync_binlog=1
innodb_safe_binlog
และที่สำคัญต้อง grant สิทธิให้ sa ด้วยคำสั่ง
grant all on *.* to sa@'%' identified by 'sa' with grant option
4. ในเครื่องที่ทำหน้าที่เป็น Slave ให้เพิ่ม ตรง section [mysqld] ดังนี้ครับ (สมมติว่าเครื่อง server มี IP Address เป็น 192.168.0.1 นะครับ)
server-id=2
master-host=192.168.0.1
master-user=sa
master-password=sa
replicate-do-db=hos
log-warnings
slave-skip-errors=all
5. ทำการ Re-Start mysql ทั้ง master และ slave
6. ที่เครื่อง slave ใช้คำสั่ง
mysql> load data from master
เพื่อทำนำเข้าข้อมูลจากเครื่อง master ไปยัง slave
มันขึ้น error 1189 Z08s01): net error reading from master
-
master-host=192.168.0.1 มันหาไม่เจอนี้ครับ
-
http://hosxp.net/index.php?option=com_smf&Itemid=28&topic=5102.0
ท้ายๆ
-
ผมจาลอง set ใหม่ครับ
-
ช่วยด้วยครับอาจารย์ทุกท่านครับ
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near
มันหมายความว่ายังไงครับ