Computer >> บทช่วยสอนคอมพิวเตอร์ >  >> การเขียนโปรแกรม >> MySQL

mysql_upgrade - ตรวจสอบและอัปเกรดตาราง MySQL

การใช้งาน

  • รันทุกครั้งหลังอัปเกรด MySQL
  • ตรวจสอบ Incompatibility กับ Server ใหม่
  • อัปเกรด System Tables ใน Schema mysql (Privileges, Capabilities ใหม่)
  • อัปเกรด Performance Schema และ sys Schema
  • ตรวจสอบ User Schemas
  • หา Incompatibility -> Table Check -> Repair หากพบปัญหา

ขั้นตอน

  1. ตรวจสอบว่า Server กำลัง Run อยู่
  2. รัน mysql_upgrade [options] อัปเกรด System Tables
  3. Check/Repair ตาราง Schema อื่นๆ
  4. Stop และ Restart Server เพื่อให้การเปลี่ยนแปลงมีผล

หลาย Server Instances

ระบุ Connection Parameters ต่อ Server:

shell> mysql_upgrade --protocol=tcp -P 3306 [other_options]
shell> mysql_upgrade --protocol=tcp -P 3307 [other_options]
shell> mysql_upgrade --protocol=tcp -P 3308 [other_options]

Unix: --protocol=tcp บังคับ TCP/IP แทน Unix Socket