New install on MySQL server appears to be looking for PostgreSQL database

Started by plum32, October 17, 2024, 10:21:03 AM

Previous topic - Next topic

plum32

Hi everyone, I am trying to setup a new forum on a MySQL database and have followed the instructions however I get this message when trying to run the install process.

Critical Error!
Cannot connect to the database server with the supplied data.

If you are not sure about what to type in, please contact your host.
2: pg_connect(): Unable to connect to PostgreSQL server: 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 5432? 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 5432? could not connect to server: Cannot assign requested address Is the server running on host "localhost" (::1) and accepting TCP/IP connections on port 5432?


The install file I downloaded is smf_2-1-4_install.zip

SMF support states:
Creating a Database with a Control Panel
If your hosting service provides a control panel interface, then this can be used to create a database. Selecting the "MySQL Databases" or "Database Wizard" options should take you to a page prompting you to create a MySQL database. With different hosts, these options may have different names.

SMF 2.1 supports MySQL, and PostgreSQL. SMF 2.0 supports MySQL, PostgreSQL and SQLite. SMF 1.1 supports only MySQL.


Would be grateful for any help :)

Kindred

well, that's part of your problem right there...  you say that you are attemptingt oconnect to a mySQL database, but you'be told the system to try PostgreSQL

1- Set up an empty databse -- record the name, username and password
2- use that information to configure your initial forum setup

if you don't know how to do #1 -- then talk to your host.

Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

plum32

Thanks, fixed it myself, it was the wrong PHP version was all - wouldn't work on 8, fine on 7. Installed on MySQL db without issue now.

Kindred

SMF 2.1.4 works very well on php 8.0 and 8.1

you should not be using php 7 at all any more
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Arantor

Sounds like the MySQLi driver wasn't installed for PHP 8 and in the event of no MySQLi driver it will just assume Postgres.
Holder of controversial views, all of which my own.


plum32

#5
"SMF 2.1.4 works very well on php 8.0 and 8.1

you should not be using php 7 at all any more"


I am not suggesting SMF doesn't work with PHP 8 I am just saying what fixed it for me...

This is the error thrown and changing php version to 7 from 8 fixed it - maybe this port number is wrong db_port = 0?

PHP Parse error: syntax error, unexpected token ";"

(Line 98)

$db_port = 0;

########## Database Info ##########
/**
* The database type
* Default options: mysql, postgresql
*
* var string
*/
$db_type = 'mysql';
/**
* The database port
* 0 to use default port for the database type
*
* var int
*/
$db_port = 0;
/**
* The server to connect to (or a Unix socket)
*
* var string
*/
$db_server = 'localhost';
/**
* The database name
*
* var string

Oldiesmann

Why are there bbcode tags in there? The "member" ones in the comments don't really matter, but the [b]$db_port = 0;[/b] is the problem. Those "b" tags shouldn't be there.
Michael Eshom
Christian Metal Fans

Arantor

It wasn't originally in code tags, where the line was bold for clarity then someone edited it into code tags.

The mentions in comments are because we have users with odd names that get picked up by the docblock syntax...
Holder of controversial views, all of which my own.


Kindred

I have corrected to remove the bbc which got added - first automatically without code tags and then showing when edited into code tags
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Advertisement: