"Allow programs to communicate through Windows Firewall"
เดิมทีปิด FireWall เอาไว้ โปรแกรมสามารถเชื่อมต่อฐานข้อมูลได้ปกติ

หลังจากเปิด Windows Firewall โปรแกรมไม่สามารถเชื่อมต่อฐานข้อมูล MySQL จากเครื่อง Client ได้

แต่เชื่อมผ่าน Localhost ได้


ให้เข้าไปเปิดที่ Control panel > Windows Firewall > Allow a program or feature through Windows Firewall เพื่อกำหนดให้ MySQL ที่เราติดตั้งไว้สามารถทำงานผ่าน Firewall ได้

หลังจากกด OK ลองกลับไปหน้าล็อกอินผ่านโปรแกรมจัดการฐานข้อมูลที่เครื่อง Client อีกครั้ง

ท่านใดใช้เครื่องมือจัดการฐานข้อมูลที่เครื่อง Client เชื่อมต่อไปยัง Server แล้วเชื่อมต่อไม่ได้ ลองตรวจสอบการตั้งค่า Windows Firewall ดูนะครับ
ข้อสังเกต

ไม่ได้เกิดจากการตั้ง Host name ของ MySQL User เพราะตั้งเป็น % เรียบร้อย (คือเชื่อมต่อได้จากทุก iP) แต่ถ้าตั้งค่า Host name แล้วแต่ยังไม่ได้จะมีข้อความแจ้งเตือนอีกแบบ
Access denied for '.....'@ 'เลขไอพีหรือComputername'
ซึ่งถ้าสั่งคิวรี่คำสั่ง
flush privileges;
ใน phpMyAdmin (ซึ่งล็อกอินด้วย user เดียวกันนี้ได้ปกติ) ก็จะทำการเชื่อมต่อจากไอพีด้านนอกได้
https://stackoverflow.com/questions/11760177/access-denied-for-root-user-in-mysql-command-line
บทความที่เกี่ยวข้อง
ความคิดเห็น
แสดงความคิดเห็น