Port เริ่มต้น
MySQL ใช้ Port 3306 เป็นค่าเริ่มต้น
ตรวจสอบด้วยคำสั่ง
mysql> SHOW VARIABLES WHERE Variable_Name = 'port';
+---------------+-------+ | Variable_Name | Value | +---------------+-------+ | port | 3306 | +---------------+-------+ 1 row in set (0.04 sec)
เปลี่ยน Port
- แก้ไข
my.ini(Windows) หรือmy.cnf(Linux) - ใน Section
[mysqld]เพิ่ม/แก้:port = 3307 - Restart MySQL Service
เชื่อมต่อ Port ที่ไม่ใช่ 3306
mysql -h host -P 3307 -u user -p
(สังเกต: -P ตัวใหญ่สำหรับ Port, -p ตัวเล็กสำหรับ Password)