BigDump การนำเข้าฐานข้อมูล sql ขนาดใหญ่ ใน phpmyadmin - TRANGNETWORK | ตรังเน็ตเวิร์คใครเจอปัญหาในการ import ข้อมูลขนาดใหญ่ผ่าน phpmyadmin มีอีกหนึ่งทางเลือก คือการใช้โปรแกรมช่วยชื่อ bigdump โดยตัวโปรแกรมเขียนด้วยภาษา PHP การทำงานของมันคือทำการ import file sql เข้าไปยังฐานข้อมูล MySql ได้อย่างไม่ต้องกังวลถึงขนาดไฟล์ sql

รายละเอียดโปรแกรม

ชื่อโปรแกรม: BigDump

ผู้เขียน: Alexey Ozerov (alexey at ozerov dot de)

ลิขสิทธ์: GNU License

สิ่งที่ต้องการ

  1. Bigdump script bigdump.php from the download ได้จาก link ข้างล่าง
  2. Dump ข้อมูลจาก database ที่สร้างโดย phpMyAdmin. สามารถใช้ GZip compressed เช่น dump.gz. GZip support เฉพาะ PHP 4.3.0 ขึ้นไป
    Note: หากใช้ gzip อาจใช้เวลาในการประมวลผลนานเนื้องจากต้อง extract file ก่อนตอนปประมวลผล
  3. Access account สำหรับ mySQL database
  4. Access account สำหรับ web server ที่มี PHP 4.1.0 หรือสูงกว่านั้นติดตั้งอยู่และสามารถติดต่อกับ mySQL database
  5. โปรแกรม text editor จำพวก Notepad เพื่อแก้ configuration file
  6. โปรแกรม FTP client สำหรับ upload files ไปยัง web server
  7. ความรู้เบื่องต้นเกี่ยวกับ PHP, mySQL databases, phpMyAdmin, FTP และ HTTP

เริ่มกันเลยครับผม

Download Script มาก่อนครับ Download

ถ้าใช้ phpmyadmin อาจจะไม่สะดวกนัก จากการที่ต้อง browse ไฟล์ขนาดใหญ่ อัพโหลดขึ้น Host อาจจะต้องส่งไฟล์ขึ้นไปหลายๆครั้ง กว่าที่การ upload ไฟล์ขึ้นไปจะสมบูรณ์

แก้โดยเปลี่ยนไปใช้ tool ตัวอื่นช่วย import ไฟล์ sql ขนาดใหญ่เข้า MySQL แตกไฟล์ออกมา มีไฟล์เดียวนั่นละ เปิดออกมาแก้ Configuration file ไม่กี่บรรทัด

  1. // Database configuration
    $db_server = 'localhost';
    $db_name = 'largeDB'; // ชื่อ db เป้าหมาย
    $db_username = 'root'; // ชื่อ username
    $db_password = ''; // รหัสผ่าน
    $max_query_lines = 300000; //ใส่ไปเยอะๆแก้ปัญหาเจอ error at this place the current query includes more than 300 dump lines.

 

Comments powered by CComment

Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Read more
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline
Marketing
Set of techniques which have for object the commercial strategy and in particular the market study.
DoubleClick/Google Marketing
Accept
Decline
Unknown
Unknown
Accept
Decline