[ปัญหา]- เกิดปัญหาในการเปิดใช้งาน postgresql ครับ

แนะนำ สอบถาม ภาษา C สำหรับผู้เริ่มต้น ภาษา Java ภาษา Python

Moderator: mindphp, ผู้ดูแลกระดาน

tatiya
PHP VIP Members
PHP VIP Members
โพสต์: 2845
ลงทะเบียนเมื่อ: 09/07/2018 9:35 am

[ปัญหา]- เกิดปัญหาในการเปิดใช้งาน postgresql ครับ

โพสต์ที่ยังไม่ได้อ่าน โดย tatiya »

คือผมได้ทำการลง ฐานข้อมูล postgresql ครับ แล้วลองทำการรันดู โดยใช้คำสั่ง บน terminal (ผมใช้ระบบปฏิบัติการ Ubuntu14.04LTS ผมลง postgresql 9.3 ครับ)

โค้ด: เลือกทั้งหมด

sudo service postgresql start
ผลลัพท์

โค้ด: เลือกทั้งหมด

* Starting PostgreSQL 9.3 database server                                      
* The PostgreSQL server failed to start. Please check the log output:
2018-08-23 11:08:07 +07 FATAL:  data directory "/var/lib/postgresql/9.3/main" has group or world access
2018-08-23 11:08:07 +07 DETAIL:  Permissions should be u=rwx (0700).
                                                                         [fail]
วิธีแก้ไขอย่างไรครับ
ภาพประจำตัวสมาชิก
mindphp
ผู้ดูแลระบบ MindPHP
ผู้ดูแลระบบ MindPHP
โพสต์: 41232
ลงทะเบียนเมื่อ: 22/09/2008 6:18 pm
ติดต่อ:

Re: [ปัญหา]- เกิดปัญหาในการเปิดใช้งาน postgresql ครับ

โพสต์ที่ยังไม่ได้อ่าน โดย mindphp »

ลอง
ls -al
ที่

โค้ด: เลือกทั้งหมด

/var/lib/postgresql/9.3/main
และ

โค้ด: เลือกทั้งหมด

/var/lib/postgresql/9.3
มาดูหน่อยครับ
ติดตาม 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
tatiya
PHP VIP Members
PHP VIP Members
โพสต์: 2845
ลงทะเบียนเมื่อ: 09/07/2018 9:35 am

Re: [ปัญหา]- เกิดปัญหาในการเปิดใช้งาน postgresql ครับ

โพสต์ที่ยังไม่ได้อ่าน โดย tatiya »

mindphp เขียน:ลอง
ls -al
ที่

โค้ด: เลือกทั้งหมด

/var/lib/postgresql/9.3/main
และ

โค้ด: เลือกทั้งหมด

/var/lib/postgresql/9.3
มาดูหน่อยครับ

โค้ด: เลือกทั้งหมด

ls -al /var/lib/postgresql/9.3/main
ผลลัพท์

โค้ด: เลือกทั้งหมด

total 68
drwxrwxrwx 15 postgres postgres 4096 ส.ค.   6 19:21 .
drwxrwxrwx  3 postgres postgres 4096 ก.ค.  12 18:18 ..
drwxrwxrwx 13 postgres postgres 4096 ก.ค.  26 13:13 base
drwxrwxrwx  2 postgres postgres 4096 ส.ค.   6 10:06 global
drwxrwxrwx  2 postgres postgres 4096 ก.ค.  12 18:18 pg_clog
drwxrwxrwx  4 postgres postgres 4096 ก.ค.  12 18:18 pg_multixact
drwxrwxrwx  2 postgres postgres 4096 ส.ค.   6 10:06 pg_notify
drwxrwxrwx  2 postgres postgres 4096 ก.ค.  12 18:18 pg_serial
drwxrwxrwx  2 postgres postgres 4096 ก.ค.  12 18:18 pg_snapshots
drwxrwxrwx  2 postgres postgres 4096 ส.ค.   6 19:21 pg_stat
drwxrwxrwx  2 postgres postgres 4096 ส.ค.   6 19:21 pg_stat_tmp
drwxrwxrwx  2 postgres postgres 4096 ก.ค.  12 18:18 pg_subtrans
drwxrwxrwx  2 postgres postgres 4096 ก.ค.  12 18:18 pg_tblspc
drwxrwxrwx  2 postgres postgres 4096 ก.ค.  12 18:18 pg_twophase
-rwxrwxrwx  1 postgres postgres    4 ก.ค.  12 18:18 PG_VERSION
drwxrwxrwx  3 postgres postgres 4096 ก.ค.  26 15:03 pg_xlog
-rwxrwxrwx  1 postgres postgres  133 ส.ค.   6 10:06 postmaster.opts

โค้ด: เลือกทั้งหมด

~$ ls -al /var/lib/postgresql/9.3
ผลลัพท์

โค้ด: เลือกทั้งหมด

drwxrwxrwx  3 postgres postgres 4096 ก.ค.  12 18:18 .
drwxrwxrwx  3 postgres postgres 4096 ก.ค.  14 13:55 ..
drwxrwxrwx 15 postgres postgres 4096 ส.ค.   6 19:21 main
mac.png
mac.png (118.54 KiB) Viewed 2577 times
ภาพประจำตัวสมาชิก
mindphp
ผู้ดูแลระบบ MindPHP
ผู้ดูแลระบบ MindPHP
โพสต์: 41232
ลงทะเบียนเมื่อ: 22/09/2008 6:18 pm
ติดต่อ:

Re: [ปัญหา]- เกิดปัญหาในการเปิดใช้งาน postgresql ครับ

โพสต์ที่ยังไม่ได้อ่าน โดย mindphp »

ถ้าเป็น 777 ในนั้นรันไม่ได้ครับ
ต้องเป็น
700
และไฟล์ config
ต้องเป็น
600
ติดตาม 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
tatiya
PHP VIP Members
PHP VIP Members
โพสต์: 2845
ลงทะเบียนเมื่อ: 09/07/2018 9:35 am

Re: [ปัญหา]- เกิดปัญหาในการเปิดใช้งาน postgresql ครับ

โพสต์ที่ยังไม่ได้อ่าน โดย tatiya »

mindphp เขียน:ถ้าเป็น 777 ในนั้นรันไม่ได้ครับ
ต้องเป็น
700
และไฟล์ config
ต้องเป็น
600
ผมไม่เข้าใจครับ 777 นี่คือเวลา ใช้คำสั่ง chmod เพื่อเปิดสิทธิ์การเข้าถึงหรอครับ
หรือยังไงครับ
tatiya
PHP VIP Members
PHP VIP Members
โพสต์: 2845
ลงทะเบียนเมื่อ: 09/07/2018 9:35 am

Re: [ปัญหา]- เกิดปัญหาในการเปิดใช้งาน postgresql ครับ

โพสต์ที่ยังไม่ได้อ่าน โดย tatiya »

tatiya เขียน:
mindphp เขียน:ถ้าเป็น 777 ในนั้นรันไม่ได้ครับ
ต้องเป็น
700
และไฟล์ config
ต้องเป็น
600
ผมไม่เข้าใจครับ 777 นี่คือเวลา ใช้คำสั่ง chmod เพื่อเปิดสิทธิ์การเข้าถึงหรอครับ
หรือยังไงครับ
ผมได้ลองทำตามดูแล้วนะครับ โดยที่ทำแบบนี้ครับ

โค้ด: เลือกทั้งหมด

sudo chmod 700 /var/lib/postgreslq/9.3/
ผลลัพท์
Selection_729.png
Selection_729.png (10.66 KiB) Viewed 2559 times
ส่วนที่ไฟล์ confic ก็

โค้ด: เลือกทั้งหมด

sudo chmod 600 /etc/postgreslq/9.3/main
ผลลัพท์
Selection_730.png
Selection_730.png (23.77 KiB) Viewed 2559 times
แล้วลองรันดู

โค้ด: เลือกทั้งหมด

sudo service postgresql start
ผลลัพท์

โค้ด: เลือกทั้งหมด

com008@com008-K45A:~$ sudo service postgresql start
sudo: /var/lib/sudo writable by non-owner (040777), should be mode 0700
[sudo] password for com008: 
 * Starting PostgreSQL 9.3 database server                                       * Error: Invalid data directory
                                                                         [fail]
Selection_731.png
Selection_731.png (24.61 KiB) Viewed 2559 times
ภาพประจำตัวสมาชิก
mindphp
ผู้ดูแลระบบ MindPHP
ผู้ดูแลระบบ MindPHP
โพสต์: 41232
ลงทะเบียนเมื่อ: 22/09/2008 6:18 pm
ติดต่อ:

Re: [ปัญหา]- เกิดปัญหาในการเปิดใช้งาน postgresql ครับ

โพสต์ที่ยังไม่ได้อ่าน โดย mindphp »

700 ที่ folder
600 ที่ไฟล์ config
ติดตาม 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
ตอบกลับโพส
  • Similar Topics
    ตอบกลับ
    แสดง
    โพสต์ล่าสุด

ผู้ใช้งานขณะนี้

สมาชิกกำลังดูบอร์ดนี้: ไม่มีสมาชิกใหม่ และบุคลทั่วไป 102