• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Gesior AAC MySQL Host

Apollo

Herban Legend
Joined
Jul 11, 2007
Messages
519
Reaction score
1
Location
Canada
I am having a problem with my Gesior AAC and my VPS / Server.

I am running my server on a VPS. I created a MySQL Database on the "Server", so, my config.lua uses "Loaclhost" as the "MySQL Host" in config.lua

I have a domain for my OT, a .com domain, and, since I forgot that I was supposed to make the MySQL Database on the DOMAINS DATABASE, meaning its not located on the domain, its located on the server itself. So, When gesior's aac uses config.lua, and tries to connect to localhost, it does not work because it is not the on the same IP as the VPS.

So, i need to:

1 - Edit gesior's AAC to make it connect to a *FIXED* Ip adress for the MySQL Host


Thanks

Xine
 
config-and-functions.php
Code:
if(isset($config['server']['mysqlHost']))
{
	//new (0.2.6+) ots config.lua file
	$mysqlhost = $config['server']['mysqlHost'];
	$mysqluser = $config['server']['mysqlUser'];
	$mysqlpass = $config['server']['mysqlPass'];
	$mysqldatabase = $config['server']['mysqlDatabase'];
}
elseif(isset($config['server']['sqlHost']))
{
	//old (0.2.4) ots config.lua file
	$mysqlhost = $config['server']['sqlHost'];
	$mysqluser = $config['server']['sqlUser'];
	$mysqlpass = $config['server']['sqlPass'];
	$mysqldatabase = $config['server']['sqlDatabase'];
}

Code:
if(strtolower($config['server']['sqlType']) == "mysql")
{
	//connect to MySQL database
	try
	{
		$ots->connect(POT::DB_MYSQL, array('host' => $mysqlhost, 'user' => $mysqluser, 'password' => $mysqlpass, 'database' => $mysqldatabase) );
	}
	catch(PDOException $error)
	{
	    echo 'Database error - can\'t connect to MySQL database. Possible reasons:<br>1. MySQL server is not running on host.<br>2. MySQL user, password, database or host isn\'t configured in: <b>'.$config['site']['server_path'].'config.lua</b> .<br>3. MySQL user, password, database or host is wrong.';
		exit;
	}
}

edit as you want to.
 
Back
Top