Page 1 of 1

Mantis 1.2.1 with Mysql on port 3316

Posted: 06 May 2010, 19:47
by colinthecat
I do not have root access to the database so I have to connect to an already existing database. The Database (Mysql 5) is created on Port 3316 instead of the standard port. However, Mantis reports Unknown MySQL server host 'localhost:3316' using both mysql or Mysqli.

I cannot get past the first screen.

THe database is working I can connect from phpMyAdmin without problem using the username and password so I don't understand what is happening here at all.

I have also tried making a simple config_inc.php with
$g_hostname = 'localhost:3316';
$g_db_username = 'dbo328703606';
$g_db_password = 'xxxxxx';
$g_database_name = 'db328703606';
$g_db_type = 'mysql';

i get Access denied for user: 'dbo328703606@localhost' (Using password: YES)
with
$g_db_type = 'mysqli';
I get

SYSTEM WARNING: mysqli_real_connect() [function.mysqli-real-connect]: (HY000/2005): Unknown MySQL server host 'localhost:3316' (1)
:?
I am confused. Can anyone help here?

Re: Mantis 1.2.1 with Mysql on port 3316

Posted: 12 May 2010, 22:43
by skayser
With $g_db_type set to 'mysql', have you tried using 127.0.0.1:3316 instead of localhost:3316?

The mysql libraries treat 'localhost' (seemingly indepent of a given port) as something which should be connected to via the Unix socket living in /var/some/path/mysql.sock per default. Thus, if you are running multiple databases on the same host the one reachable via the Unix socket might not be the one you are after. Using 127.0.0.1 instead connects via TCP and honours different port settings. For some further info see e.g. http://bugs.mysql.com/bug.php?id=31577.

Not sure about mysqli, haven't used it myself yet.