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

วิธีหาไฟล์ my.cnf (my.ini) ใน Windows

ตำแหน่งมาตรฐาน Windows

Windows ใช้ชื่อไฟล์ my.ini (ไม่ใช่ my.cnf)

ตำแหน่งทั่วไป: C:\ProgramData\MySQL\MySQL Server 8.0\my.ini

หาผ่าน Services (แน่ใจที่สุด)

  1. Win + R → services.msc → Enter
  2. หา MySQL80 (หรือชื่อ Service MySQL)
  3. คลิกขวา → Properties
  4. ดู Path to executable จะเป็นแบบ:
    "C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe" --defaults-file="C:\ProgramData\MySQL\MySQL Server 8.0\my.ini"
  5. ค่าหลัง --defaults-file= คือตำแหน่ง my.ini จริง

ตำแหน่งที่เป็นไปได้อื่นๆ

  • C:\Program Files\MySQL\MySQL Server 8.0\my.ini
  • C:\Windows\my.ini (เก่า)
  • my.cnf ในโฟลเดอร์ Data Directory

MySQL อ่านตามลำดับความสำคัญ: --defaults-file > ตำแหน่งมาตรฐาน > โฟลเดอร์ Windows