วันอาทิตย์ที่ 23 ตุลาคม พ.ศ. 2554

วิธีติดตั้ง phpmyadmin

ปกติ..หากเราติดตั้ง phpmyadmin แบบดาว์นโหลดมาติดตั้งเอง...บน linux หรือ unix เริ่มต้นโดยการแตกไฟล์
แล้วนำไปไว้ห้อง ducumentroot ของ web Server เช่น /var/www/html/phpmyadmin/ เป็นต้น
หลังจากนั้นให้เข้าไปในห้อง /phpmydmin/libraries หาไฟล์ชื่อ config.default.php ทำการ copy ขึ้นมาไว้ที่ห้อง
/var/www/phpmyadmin/ แล้วทำการเปลี่ยนชื่อไฟล์ เป็น config.inc.php
ทำการแก้ไข config ไฟล์ดังนี้
$cfg['blowfish_secret'] = 'ใส่รหัสความปลอดภัยอะไรก็ได้...';
$cfg['Servers'][$i]['controluser'] = 'root';
$cfg['Servers'][$i]['controlpass'] = 'passwordmysql'; ใส่รหัส mysql root
$cfg['Servers'][$i]['auth_type'] = 'http'; เปลี่ยนจาก cookie เป็น http

/**
* MySQL user
*
* @global string $cfg['Servers'][$i]['user']
*/
$cfg['Servers'][$i]['user'] = 'root';

/**
* MySQL password (only needed with 'config' auth_type)
*
* @global string $cfg['Servers'][$i]['password']
*/
$cfg['Servers'][$i]['password'] = 'passwordmysql';

/**

/**
* Database used for Relation, Bookmark and PDF Features
* (see scripts/create_tables.sql)
* - leave blank for no support
* SUGGESTED: 'phpmyadmin'
*
* @global string $cfg['Servers'][$i]['pmadb']
*/
$cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';

/**
* Bookmark table
* - leave blank for no bookmark support
* SUGGESTED: 'pma_bookmark'
*
* @global string $cfg['Servers'][$i]['bookmarktable']
*/
$cfg['Servers'][$i]['bookmarktable'] = 'pma_bookmark';

/**
* table to describe the relation between links (see doc)
* - leave blank for no relation-links support
* SUGGESTED: 'pma_relation'
* @global string $cfg['Servers'][$i]['relation']
*/
$cfg['Servers'][$i]['relation'] = 'pma_relation';

/**
* table to describe the display fields
* - leave blank for no display fields support
* SUGGESTED: 'pma_table_info'
*
* @global string $cfg['Servers'][$i]['table_info']
*/
$cfg['Servers'][$i]['table_info'] = 'pma_table_info';

/**
* table to describe the tables position for the PDF schema
* - leave blank for no PDF schema support
* SUGGESTED: 'pma_table_coords'
*
* @global string $cfg['Servers'][$i]['table_coords']
*/
$cfg['Servers'][$i]['table_coords'] = 'pma_table_coords';

/**
* table to describe pages of relationpdf
* - leave blank if you don't want to use this
* SUGGESTED: 'pma_pdf_pages'
*
* @global string $cfg['Servers'][$i]['pdf_pages']
*/
$cfg['Servers'][$i]['pdf_pages'] = 'pma_pdf_pages';

/**
* table to store column information
* - leave blank for no column comments/mime types
* SUGGESTED: 'pma_column_info'
*
* @global string $cfg['Servers'][$i]['column_info']
*/
$cfg['Servers'][$i]['column_info'] = 'pma_column_info';
/**
* table to store SQL history
* - leave blank for no SQL query history
* SUGGESTED: 'pma_history'
*
* @global string $cfg['Servers'][$i]['history']
*/
$cfg['Servers'][$i]['history'] = 'pma_history';

/**
* table to store the coordinates for Designer
* - leave blank for no Designer feature
* SUGGESTED: 'pma_designer_coords'
*
* @global string $cfg['Servers'][$i]['designer_coords']
*/
$cfg['Servers'][$i]['designer_coords'] = 'pma_designer_coords';

/**
* table to store SQL tracking
* - leave blank for no SQL tracking
* SUGGESTED: 'pma_tracking'
*
* @global string $cfg['Servers'][$i]['tracking']
*/
$cfg['Servers'][$i]['tracking'] = 'pma_tracking';

/**
* table to store user preferences
* - leave blank to disable server storage
* SUGGESTED: 'pma_userconfig'
*
* @global string $cfg['Servers'][$i]['userconfig']
*/
$cfg['Servers'][$i]['userconfig'] = 'pma_userconfig';

/**
ทำการบันทึกไฟล์ config.inc.php สั่ง chmod 755 ไฟล์ config.inc.php
เข้า http://xx.xxx.xx.xx/phpmyadmin/
ทำการสร้างฐานข้อมูลชื่อ phpmyadmin
สั่ง import script ชื่อ create_table.sql ในไฟล์ที่โหลดมา อยู่ในห้อง /script
แค่นี้ก็จะทำให้ phpmyadmin ไม่มีอะไรแจ้งเตือนให้รำคาณใจอีก..เย้ ๆ ๆ ๆ ๆ
อีกนิดสำหรับเวลาสร้างฐานข้อมูลให้ user แต่ละคน login ด้วยชื่อตัวเอง..แบบไม่มีสิทธิ์สร้างฐานอื่นมีสิทธิ์แค่ฐานข้อมูลตัวเอง..
เข้าในฐานะ root สร้างฐานข้อมูล เสร็จแล้วมาที่ privileges เลือก add user เลือก
Create database with same name and grant all privileges

ไม่มีความคิดเห็น: