ติดตั้ง pgAdmin III แต่ไม่สามารถสร้างดาต้าได้

ตอบกระทู้

รูปแสดงอารมณ์
:icon_plusone: :like: :plusone: :gfb: :-D :) :( :-o 8O :? 8) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :!: :?: :idea: :arrow: :| :mrgreen: :angry: :baa: :biggrin:
รูปแสดงอารมณ์อื่นๆ

BBCode เปิด
[img] เปิด
[url] เปิด
[Smile icon] เปิด

กระทู้แนะนำ
   

มุมมองที่ขยายได้ กระทู้แนะนำ: ติดตั้ง pgAdmin III แต่ไม่สามารถสร้างดาต้าได้

Re: ติดตั้ง pgAdmin III แต่ไม่สามารถสร้างดาต้าได้

โดย บัวบุญ จันทะโคตร » 14/07/2017 12:55 pm

ขั้นตอนการแก้ไขปัญหาลง postgresql ไม่สามารถติดต่อกับเซิฟเวอร์ได้
ขั้นตอนที่ 1 ให้ทำตามลิงค์ขั้นตอนลงมาเรื่อยๆ
http://dev-pages.info/how-to-install-po ... ntu-16-04/


*** หากมี ปัญหาในการติดตั้ง postgresql ให้พิมพ์โค้ดใน terminal ดังนี้
ขั้นตอนที่ 1

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

sudo apt-get update && sudo apt-get upgrade
ขั้นตอนที่ 2

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

sudo apt-get purge postgresql*
ขั้นตอนที่ 3

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

sudo apt-get -f install
ขั้นตอนที่ 4

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

sudo apt-get install postgresql

จากนั้นให้ท่านพิมพ์โค้ดต่อไปนี้
พิมพ์ พิมพ์

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

su - postgres
พิมพ์ พิมพ์

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

 \password

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

ENTER YOUR PASSWORD (ใส่พาสเวิดได้ตามต้องการ)
แล้วลองเปิดโปรแกรม pdadmin3 แล้วสร้างชื่อฐานข้อมูล และ ใส่ password ที่ท่านเคยตั้งไว้ก่อนหน้านี้ลงไป เป็นอันใช้งานได้

Re: ติดตั้ง pgAdmin III แต่ไม่สามารถสร้างดาต้าได้

โดย บัวบุญ จันทะโคตร » 14/07/2017 11:39 am

ผมลองใช้คำสั่ง

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

sudo systemctl status postgresql
ผลที่ได้จากการรัน

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

● postgresql.service - PostgreSQL RDBMS
   Loaded: loaded (/lib/systemd/system/postgresql.service; enabled; vendor prese
   Active: active (exited) since ศ. 2017-07-14 11:36:40 ICT; 26s ago
 Main PID: 9777 (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/postgresql.service

ก.ค. 14 11:36:40 com010-X450JF systemd[1]: Starting PostgreSQL RDBMS...
ก.ค. 14 11:36:40 com010-X450JF systemd[1]: Started PostgreSQL RDBMS.
ก.ค. 14 11:36:47 com010-X450JF systemd[1]: Started PostgreSQL RDBMS.
ถือเป็นการเช็คการทำงาน service ของ postgresql หรือเปล่าครับ

Re: ติดตั้ง pgAdmin III แต่ไม่สามารถสร้างดาต้าได้

โดย mindphp » 14/07/2017 10:26 am

เช็คด้วย command ก่อนว่า Service ของ PostgreSQL ทำงานหรือยัง

Re: ติดตั้ง pgAdmin III แต่ไม่สามารถสร้างดาต้าได้

โดย บัวบุญ จันทะโคตร » 14/07/2017 9:36 am

ภาพตอนจะสร้างฐานข้อมูล
Screenshot 2017-07-14 09_30_47.png
Screenshot 2017-07-14 09_30_47.png (23.4 KiB) Viewed 2077 times
ข้อความ Error

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

Server doesn't listen
The server doesn't accept connections: the connection library reports 
could not connect to server: Connection refused Is the server running on host "localhost" (127.0.0.1) and accepting TCP/IP connections on port 5433? 
If you encounter this message, please check if the server you're trying to contact is actually running PostgreSQL on the given port. Test if you have network connectivity from your client to the server host using ping or equivalent tools. Is your network / VPN / SSH tunnel / firewall configured correctly? 
For security reasons, PostgreSQL does not listen on all available IP addresses on the server machine initially. In order to access the server over the network, you need to enable listening on the address first.
For PostgreSQL servers starting with version 8.0, this is controlled using the "listen_addresses" parameter in the postgresql.conf file. Here, you can enter a list of IP addresses the server should listen on, or simply use '*' to listen on all available IP addresses. For earlier servers (Version 7.3 or 7.4), you'll need to set the "tcpip_socket" parameter to 'true'. 
You can use the postgresql.conf editor that is built into pgAdmin III to edit the postgresql.conf configuration file. After changing this file, you need to restart the server process to make the setting effective. 
If you double-checked your configuration but still get this error message, it's still unlikely that you encounter a fatal PostgreSQL misbehaviour. You probably have some low level network connectivity problems (e.g. firewall configuration). Please check this thoroughly before reporting a bug to the PostgreSQL community. 

Re: ติดตั้ง pgAdmin III แต่ไม่สามารถสร้างดาต้าได้

โดย mindphp » 13/07/2017 5:26 pm

ยังไม่ได้ ขึ้นข้อความว่าอะไร ครับ
มี Error ให้ดูไหม

Re: ติดตั้ง pgAdmin III แต่ไม่สามารถสร้างดาต้าได้

โดย บัวบุญ จันทะโคตร » 13/07/2017 4:45 pm

จากปัญหาที่ได้เจอมา ได้มีการแก้ไขให้ใช้งานได้เรียบร้อยแล้ว แต่ขั้นตอนที่ผมลงไปนั้นยังเป็นขั้นตอนที่ไม่สมบรุณ์ โดยยังขาดตกบกพ่องในบางส่วนครับ ให้ทำให้พอผมลง ubuntu ใหม่อีกครั้งแล้วทำตามขั้นตอน ปรากฏว่า ก็ยังไม่สามารถเชื่อมต่อฐานข้อมูลได้ครับ

Re: ติดตั้ง pgAdmin III แต่ไม่สามารถสร้างดาต้าได้

โดย บัวบุญ จันทะโคตร » 01/07/2017 2:20 pm

วิธีแก้ไข connect pgadmin ไม่ได้
ขั้นตอนที่ 1 ให้เราทำตามลิ้งค์นี้นะครับ
https://www.mindphp.com/%E0%B8%9A%E0%B8% ... 12.04.html
ขั้นตอนที่ 2 ให้เราไปตั้งค่า pgadmin III ตามลิ้งค์ด้านล่างนี้นะครับ
https://www.mindphp.com/developer/21-sql ... sword.html
จากนั้นให้เรา เปิด terminal ขึ้นมา แล้วทำการพิมพ์คำสั่งนี้ลงไป

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

sudo passwd postgres
จากนั้นให้เราตั้งค่า password ใหม่ และยืนยัน password ดังรูป
Screenshot 2017-07-01 14-18-14.png
Screenshot 2017-07-01 14-18-14.png (8.52 KiB) Viewed 2102 times

Re: ติดตั้ง pgAdmin III แต่ไม่สามารถสร้างดาต้าได้

โดย mindphp » 30/06/2017 11:04 pm

ข้อความ Error copy มาแปะเป็นคำถามได้เลยครับ ไม่ต้อง cap เป็นภาพ

Port default #PGSQL เป็น 5432 นะครับ
และเช็ค user,password ดูอีกที ว่าได้สร้าง user นั้นไว้หรือยัง

ติดตั้ง pgAdmin III แต่ไม่สามารถสร้างดาต้าได้

โดย บัวบุญ จันทะโคตร » 30/06/2017 3:46 pm

เมื่อผมจะสร้างดาต้าเบสแล้ว ก็ตั้งค่าดังรูปนี้
Screenshot 2017-06-30 15-41-26.png
Screenshot 2017-06-30 15-41-26.png (13.48 KiB) Viewed 2117 times
พอกด "ตกลง" มันขึ้นแบบนี้ ต้องแก้ไขยังไงครับ
Screenshot from 2017-06-30 09-49-26.png
Screenshot from 2017-06-30 09-49-26.png (23.43 KiB) Viewed 2117 times

ข้างบน