I too had a fair bit of trouble getting postgresql working on CentOS, only having minimal experience with linux.
Here's what ended up working for me. First, you'll want to install
To view the content, you need to sign in or register
. During install, just select the "minimal" version.
Setting up the lan connection is a bit different since ifup doesn't work, use nmcli instead.
To get the name of the adapter. It is probably enp0s3:
nmcli con show
Change this to whatever IP you want the vm to have:
nmcli con mod enp0s3 ipv4.addresses 192.168.20.96/24
The IP of your router:
nmcli con mod enp0s3 ipv4.gateway 192.168.20.1
Not 100% sure I did this right, but here's the 2 usual google dns:
nmcli con mod enp0s3 ipv4.dns “8.8.8.8 8.8.4.4”
Disable dhcp:
nmcli con mod enp0s3 ipv4.method manual
Save and activate:
nmcli con up enp0s3
Confirm it worked:
ip addr
Confirm that postgresql is available:
dnf module list postgresql
Install postgresql:
dnf install postgresql -y
install dblink:
yum install postgres*contrib -y
Not sure if it's needed, but I also ran this:
dnf install postgresql-server -y
From here, pretty much just following the tutorial as normal and it's fine so far, will report back if everything works. Some small changes, like
service postgresql initdb instead of
service postgresql-9.3 initdb will be needed.
Edit: For tonight, I am stuck at connecting to postgres with pgAdmin4 (as opposed to Navicat in the tutorial). I assume this is just some kind of linux-equivalent firewall issue I need to sort out somehow.
Edit 2: Found the solution,
sudo firewall-cmd --add-service=postgresql --permanent. Also do
systemctl enable postgresql.service so the postgresql service will autostart from now on, and then restart the vm. Able to connect with pgAdmin4 now. If I can get the server fully working, might make a new tutorial thread, since all the tutorials available seem very dated.
Edit 3: Quick guide on doing the Navicat part with pgAdmin4. Right click on ffmember and select Query Tool, then input the line from the tutorial, and press F5:
INSERT INTO tb_user (mid, password, pwd) VALUES ('test', 'test', '098f6bcd4621d373cade4e832627b4f6')
Do the same for the ffaccount line in step 5.
For step 6 of the tutorial, go into the query tool for each relevant table and use these commands:
UPDATE worlds SET ip = '[your_ip]';
SELECT * FROM worlds;
UPDATE serverstatus SET ext_address = '[your_ip]' WHERE id > 0;
SELECT * FROM serverstatus;