ก่อนหน้านี้ผมเองก็ใช้แต่ Appserv มาตลอด เนื่องจากเว็บหลาย ๆ อันที่ดูแลอยู่ก็ใช้ Appserv ก็เลยยังไม่เคยได้ลองเปลี่ยนมาใช้ XAMPP ที่กำลังเป็นที่นิยมกันอยู่ในขณะนี้ แต่เมื่ออยู่วงการนี้ เทคโนโลยีเปลี่ยน เราก็ต้องปรับตัว เปลี่ยนแปลงกันตามยุค ตามสมัยกันใช่ไหมครับ ก็เลยได้มีโอกาสลองติดตั้ง ใช้งานเจ้า XAMPP ทำให้เจอปัญหาหลาย ๆ อย่าง ซึ่งอันไหนที่คิดว่าน่าจะเป็นประโยชน์ หรือ แนวทางแก้ไขให้เพื่อน ๆ น้อง ๆ ที่อาจจะเจอปัญหาเดียวกันกับที่ผมเจออยู่ เลยอัดเป็นคลิปวีดีโอไว้ด้วยซะเลย 5555++ (ว่างจัด)
ปัญหาและสาเหตุที่ทำให้เกิดเออเร่อนี้
เกิดจากการที่เรายังไม่ได้กำหนดค่าในไฟล์ config.inc.php ( auth_type , user และ password )
อ้างอิงจากอาการที่ผมเจอ และแก้ไชได้แล้ว (ตามในคลิปด้านล่าง)
วิธีแก้ไขปัญหานี้
- เปิดโฟลเดอร์ XAMPP ในเครื่อง (ติดตั้งไว้ที่ไหน ก็เปิดให้ถูกนะครับ)
- เปิดไฟล์ config.inc.php ขึ้นมา
- เปลี่ยนค่า auth_type จาก config เป็น http
- กำหนดรหัสผ่านของแอดมิน หรือ root ตามที่เราต้องการ (ในที่นี้ตั้งค่าเป็น 123456)
- บันทึกไฟล์ config.inc.php
- ลองเข้า phpMyadmin อีกครั้ง
แก้ไขเสร็จแล้วจะได้ไฟล์ประมาณนี้นะครับ (โค้ดสีเขียว คือจุดที่ต้องแก้ไข หรือ ตั้งค่า)
<?php
/*
* This is needed for cookie based authentication to encrypt password in
* cookie
*/
$cfg['blowfish_secret'] = 'xampp'; /* YOU SHOULD CHANGE THIS FOR A MORE SECURE COOKIE AUTH! */
/*
* Servers configuration
*/
$i = 0;
/*
* First server
*/
$i++;
/* Authentication type and info */
$cfg['Servers'][$i]['auth_type'] = 'http';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '123456';
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['AllowNoPassword'] = true;
$cfg['Lang'] = '';
/* Bind to the localhost ipv4 address and tcp */
$cfg['Servers'][$i]['host'] = '127.0.0.1';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
/* User for advanced features */
$cfg['Servers'][$i]['controluser'] = 'pma';
$cfg['Servers'][$i]['controlpass'] = '';
/* Advanced phpMyAdmin features */
$cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
$cfg['Servers'][$i]['bookmarktable'] = 'pma__bookmark';
$cfg['Servers'][$i]['relation'] = 'pma__relation';
$cfg['Servers'][$i]['table_info'] = 'pma__table_info';
$cfg['Servers'][$i]['table_coords'] = 'pma__table_coords';
$cfg['Servers'][$i]['pdf_pages'] = 'pma__pdf_pages';
$cfg['Servers'][$i]['column_info'] = 'pma__column_info';
$cfg['Servers'][$i]['history'] = 'pma__history';
$cfg['Servers'][$i]['designer_coords'] = 'pma__designer_coords';
$cfg['Servers'][$i]['tracking'] = 'pma__tracking';
$cfg['Servers'][$i]['userconfig'] = 'pma__userconfig';
$cfg['Servers'][$i]['recent'] = 'pma__recent';
$cfg['Servers'][$i]['table_uiprefs'] = 'pma__table_uiprefs';
$cfg['Servers'][$i]['users'] = 'pma__users';
$cfg['Servers'][$i]['usergroups'] = 'pma__usergroups';
$cfg['Servers'][$i]['navigationhiding'] = 'pma__navigationhiding';
$cfg['Servers'][$i]['savedsearches'] = 'pma__savedsearches';
$cfg['Servers'][$i]['central_columns'] = 'pma__central_columns';
$cfg['Servers'][$i]['designer_settings'] = 'pma__designer_settings';
$cfg['Servers'][$i]['export_templates'] = 'pma__export_templates';
$cfg['Servers'][$i]['favorite'] = 'pma__favorite';
/*
* End of servers configuration
*/
?>
ใครที่กำลังเจอปัญหา Xampp เข้า phpMyadmin ไม่ได้ ก็ลองทำตามในคลิปดูนะครับ
หวังว่าบทความนี้จะช่วยแก้ปัญหาที่เพื่อน ๆ เจออยู่ได้ หากเออเร่อเดียวกัน แต่แก้ไข หรือทำตามที่ผมแนะนำแล้วยังไม่ได้ ก็อาจจะมีวิธีอื่นอีก ซึ่งก็ต้องค้นหาดูกันเอาเองนะครับ
ขอบคุณทุกท่านที่แวะเข้ามาเยี่ยมชมเว็บไซต์ของเรา www.code-father.com