max_allowed_packet คืออะไร ฐานข้อมูล MySQL, mariadb
max_allowed_packet คือค่าที่ฐานข้อมูลยอมรับในการรับส่ง packet ระหว่างเครื่อง client กับ Server หรือ การรันคำสั่งใน ฐาข้อมูลแต่ละครั้ง ปกติ จะส่วนที่ร้องขอเข้ามาเพื่อรันคำสั่ง เช่น เราเขียน SQL ยาว แล้ว มาสั่ง Query ทีเดียว ถ้าค่านี้ กำหนดไว้น้อย เกินไป ก่อนอาจมี Error ส่งคำสั่งเข้ามาเกินที่ Server จะทำงานได้ ก็จะเจอ Error ข้อความ เกี่ยวกับ memory กลับไปแจ้ง
โดยปกติ MySQLจะมีค่ามาตรฐาน หรือค่า default ของมัน ไว้ที่ 2M
ส่วนของ mariadb ค่า default ก็จะเปลี่ยนไปตามเวอร์ชั่น
16777216 (16M) >= MariaDB 10.2.4
4194304 (4M) >= MariaDB 10.1.7
1048576 (1MB) <= MariaDB 10.1.6
ของจากการ config ตัวนี้แล้ว ยังมีค่า config ที่เกี่ยวข้องอีกตัว คือ net_buffer_length ไว้ติดตามตอนต่อไป
แล้วเราจะเปลี่ยนค่านี้ได้ที่ไหน คำตอบคือ my.cnf สำหรับ Linux แล้ว my.ini สำหรับ windows
กระทู้ที่พูดถึงเรื่องนี้ ในบอร์ดเรา เช่น
ปัญหา MySQL server has gone away (error 2006)
viewtopic.php?f=27&t=16149
Fatal error Allowed memory size of 134217728 bytes exhausted
viewtopic.php?f=6&t=9747
ความรู้เพิ่มเติม
ทำให้ Mysql บน Host สามารถ connect จากเครื่องอื่นได้ my.cnf
max_allowed_packet คืออะไร ฐานข้อมูล MySQL , mariadb
Moderators: mindphp, ผู้ดูแลกระดาน
- mindphp
- ผู้ดูแลระบบ MindPHP
- Posts: 26591
- Joined: 22/09/2008 6:18 pm
- Contact:
max_allowed_packet คืออะไร ฐานข้อมูล MySQL , mariadb
ติดตาม VDO: http://www.youtube.com/c/MindphpVideoman
ติดตาม FB: https://www.facebook.com/pages/MindphpC ... 9517401606
หมวดแชร์ความรู้: https://www.mindphp.com/forums/viewforum.php?f=29
รับอบรม และพัฒนาระบบ: https://www.mindphp.com/forums/viewtopic.php?f=6&t=2042
ติดตาม FB: https://www.facebook.com/pages/MindphpC ... 9517401606
หมวดแชร์ความรู้: https://www.mindphp.com/forums/viewforum.php?f=29
รับอบรม และพัฒนาระบบ: https://www.mindphp.com/forums/viewtopic.php?f=6&t=2042
-
- Similar Topics
- Replies
- Views
- Last post
-
- 2 Replies
- 1071 Views
-
Last post by cresencio123
13/11/2020 9:30 pm
-
-
ตั้งค่าไม่ให้ Mysql เก็บ binary logs ใช้ได้กับ MariaDB
by mindphp » 03/04/2016 5:19 pm » in Linux - Web Server - 1 Replies
- 553 Views
-
Last post by mindphp
03/04/2016 5:47 pm
-
-
-
Mysql เกี่ยวกับการแก้ไข และ update ฐานข้อมูล ใน php
by dexjanghan » 05/03/2011 1:29 pm » in Programming - PHP - 3 Replies
- 14307 Views
-
Last post by 4404
08/03/2011 3:55 pm
-
-
-
SQL สำหรับเปลี่ยนชื่อตาราง Table ใน ฐานข้อมูล MySQL 5.7 และ เวอร์ชั่นอื่น
by thatsawan » 13/04/2016 3:54 pm » in SQL Knowledge - 0 Replies
- 938 Views
-
Last post by thatsawan
13/04/2016 3:54 pm
-
-
-
[โค้ด] ฟังก์ชัน backup ฐานข้อมูล mysql
by touleg » 03/05/2011 4:31 pm » in Free PHP Code Download script - 0 Replies
- 5109 Views
-
Last post by touleg
03/05/2011 4:31 pm
-
-
-
อ่านชื่อ ฐานข้อมูล และ ดึงรายละเอียดของตารางที่ Joomla ใช้งานไปฐานข้อมูล Mysql
by mindphp » 21/05/2016 3:38 am » in Joomla Developing Knowledge - 0 Replies
- 648 Views
-
Last post by mindphp
21/05/2016 3:38 am
-
-
- 0 Replies
- 1020 Views
-
Last post by mindphp
25/08/2019 3:55 pm
-
-
ตัวอย่างโค้ด PHP ติดต่อ ฐานข้อมูล ของ Hosting godaddy ที่นี่ใช้ Mysql 5.0
by mindphp » 12/10/2013 8:38 pm » in Programming - PHP - 0 Replies
- 2675 Views
-
Last post by mindphp
12/10/2013 8:38 pm
-
Who is online
Users browsing this forum: No registered users and 7 guests