Page 1 of 1

MySQL on a different machine. Is this possible?

Posted: 27 Apr 2010, 15:23
by blackcat
Hi,

I have installed Apache and PHP and Mantis into a machinne (Linux red hat), but I have a database (MySQL) on a different machine.

Mantis is it possible to configure to point to this database is on the other machine?

I have change config_inc.php like:

Code: Select all

$g_hostname      = 'xxx.xxx.xxx.xxx';
$g_db_username   = 'ususermantis';
$g_db_password   = 'passw';
$g_database_name = 'mantis_DB';
$g_db_type       = 'mysql';
But when I go to the home page, I get this error in the browser:
SYSTEM WARNING: mysql_connect() [function.mysql-connect]: Access denied for user 'ususermantis'@'yyy.yyy.yyy.yyy' (using password: YES)
Fatal error: Call to undefined function event_clear_callbacks() in /usr/local/apache2/htdocs/mantis/core/error_api.php on line 135
where xxx.xxx.xxx.xxx is the machine where is the apache, php and mantis and
yyy.yyy.yyy.yyy is the machine where is MySQL

Re: MySQL on a different machine. Is this possible?

Posted: 29 Apr 2010, 13:25
by cas
Localhost needs to be the server that holds MySQL :D

Re: MySQL on a different machine. Is this possible?

Posted: 12 May 2010, 21:12
by skayser
cas wrote:Localhost needs to be the server that holds MySQL :D
Sorry, not true, Mantis runs perfectly fine with a remote MySQL host. The error message points to an authentication problem.

@blackcat: Make sure you can connect from the Mantis host to the MySQL host with the mysql command line utility first.

Code: Select all

mysql -h <mysqlhost> -u <user> -p <mantis_database>
When that's working properly, you can move on to Mantis. Otherwise investigate the permissions on the MySQL server, your Mantis user needs to have remote access privileges to the Mantis database.

Code: Select all

GRANT ALL PRIVILEGES ON mantisbt.* TO <mantisuser>@<mantishost> IDENTIFIED BY '<mantispassword>';