View previous topic :: View next topic |
Author |
Message |
Baaleos
Joined: 02 Sep 2007 Posts: 830
|
Posted: Sun Sep 02, 2007 17:44 Post subject: GameServer using mysql on a webserver? |
|
|
Ok, I am trying to get simtools for nwn working, and they actually refered me here. Lol
I have the following set up,
NWNX ini is pointing towards my website ip address, with sql databases names, usernames, and passwords all filled in.
My website is set up to allow my gameservers ip address to access the databases.
I attempt to click on the placeable in the simtools test mod, and it says it has made tables pwdata in the nwn database i created,
I check with phpmyadmin, and no data, or tables were created.
Can somone tell me if nwnx is cabable of cross server database usage? I assumed it could do it, since it does ask for an ip address, I mean, if it could only work with localhosts, then surely it wouldnt need ip address's.
Can somone give me a hint? |
|
Back to top |
|
|
FunkySwerve
Joined: 02 Jun 2005 Posts: 377
|
Posted: Mon Sep 03, 2007 8:05 Post subject: |
|
|
More specifically, he isn't even getting an odbc log created. Missing dll?
Funky |
|
Back to top |
|
|
PhyrPhly
Joined: 16 Jun 2007 Posts: 25
|
Posted: Mon Sep 03, 2007 22:18 Post subject: Re: GameServer using mysql on a webserver? |
|
|
MySQL does not have to be on the same machine that NWN/NWNX are on.
1) Check "nwnx.txt" for "* Plugin odbc is loaded." If it's not there, check your NWNX setup.
2) If 1) is OK, check "nwnx_odbc.txt" for errors. Correct any errors.
3) If 1) and 2) are OK, check privileges on your MySQL DB for the user set up in the nwnx.ini for the MySQL connection. I'm not sure how to check that with phpmyadmin, but the mysql command-line command is "show grants for <user>@<nwnserver>"
ex. Quote: | mysql> show grants for nwnxuser@mynwnserver |
- PhyrPhly |
|
Back to top |
|
|
FunkySwerve
Joined: 02 Jun 2005 Posts: 377
|
Posted: Thu Sep 06, 2007 2:29 Post subject: |
|
|
Figured it out. He hadn't compiled the mod after configuring the script, so was attempting to use the SQLite nwscript with the MySQL ini settings.
Funky |
|
Back to top |
|
|
Baaleos
Joined: 02 Sep 2007 Posts: 830
|
Posted: Thu Sep 06, 2007 22:32 Post subject: Not working still |
|
|
Not really sorted... my game server is working fine using sqllite, but i still want mysql working.
I am getting the following error now
! SQL Error: [Microsoft][ODBC Microsoft Access Driver] The Microsoft Jet database engine cannot find the input table or query 'pwdata'. Make sure it exists and that its name is spelled correctly.
The logs do show that it connects to the database, it just doesnt wana do anything with pwdata table. But, saying that, other tables that exist, arnt functioning either.
Code: | ; NWNX2 configuration file
; These are the default values for NWNX2. Values specified on the command
; line take precedence.
[NWNX]
ServerPort = 5121
ModuleName = "A world of Rhun v2-11a"
WatchdogProcess = yes
UpdateIntervalProcess = 5
WatchdogGamespy = yes
UpdateIntervalGamespy = 5
GamespyRetries = 5
OldGamespyProtocol = no
RestartDelay = 5
[ODBC2]
; Log file
MaxLogSize = 512 ; in KByte
LogLevel = 2 ; 0=nothing, 1=only errors, 2=everything
; Use these two settings for the SQLite internal database
;source = sqlite
;file = sqlite.db
; Use these two settings for ODBC connections
source = odbc
dsn = nwn
; Use these five settings for MySQL connections
source = mysql
server = 74.220.204.131
user = azmodann_Baaleos
pwd = ######
db = azmodann_nwn
; Set hookscorco to false if you want to disable hooking of
; StoreCampaignObject and RetrieveCampaignObject entirely
hookscorco = true
[PROFILER]
MaxLogSize = 512 ; in KByte
LogLevel = 1 ; 1=overall statistics, 2=full script callstack
[CHAT]
chat_script = fky_chat
server_script = fky_chat_srv
|
Last edited by Baaleos on Thu Sep 06, 2007 22:53; edited 1 time in total |
|
Back to top |
|
|
Baaleos
Joined: 02 Sep 2007 Posts: 830
|
Posted: Thu Sep 06, 2007 22:48 Post subject: |
|
|
is my username in the form
azmodann@localhost (this retuns vaules in the query window)
or
azmodann_bhaal or azmodann_baaleos (these are 2 usernames i created for the database being used) |
|
Back to top |
|
|
Baaleos
Joined: 02 Sep 2007 Posts: 830
|
Posted: Fri Sep 07, 2007 3:20 Post subject: Damn... |
|
|
this seems to be the closest I/we have got to getting it working.
I have given remote sql access to my gameserver from my webserver,
I have put in several different combo's of username password, just incase its somthing to do with that.
these are the logs i get back
Code: | NWN Extender V.2.6.1
(c) 2005 by Ingmar Stieger (Papillon) and Jeroen Broekhuizen
visit us at http://www.nwnx.org
* Loading plugins...
* Plugin chat is loaded.
* Plugin leto is loaded.
* Library ODBC!SPACER does not exist.* An error occured during OnCreate of odbc
* Plugin resetplugin is loaded.
* NWNX2 activated.
* NWNX2 shutting down...
* NWNX2 shutdown successfull. |
Code: | NWNX ODBC2 plugin V.0.9.2.4
(c) 2005 by Ingmar Stieger (Papillon) and Jeroen Broekhuizen
visit us at http://www.nwnx.org
o Logfile maximum size limit is: 524288 bytes
o Log level: Everything will be logged.
o Using MySQL connection.
o Hooking SCO....hooked at 5d3560
o Hooking RCO....hooked at 5d3440
! Error while connecting to database: Can't connect to MySQL server on '74.220.204.131' (10060)
o Got request: DROP TABLE pwdata
! SQL Error: Can't connect to MySQL server on '74.220.204.131' (10060)
o Got request: CREATE TABLE pwdata (player varchar(64) NOT NULL default '~',tag varchar(64) NOT NULL default '~',name varchar(64) NOT NULL default '~',val text,expire int(11) default NULL,last timestamp NOT NULL default CURRENT_TIMESTAMP,PRIMARY KEY (player,tag,name)) ENGINE=MyISAM DEFAULT CHARSET=latin1;
! SQL Error: Can't connect to MySQL server on '74.220.204.131' (10060)
o Disconnecting from database. |
I have various copies of these log files, i hope i sent the right ones...
The spacer error seems to be the most "promissing" error, it sorta makes me think that it could be formatting or somthing related.
Can somone give me a hand?
Here is some more info.
// Name : Demo create table
// Purpose : Create a table for persistent data
// Authors : Ingmar Stieger
// Modified : February 02, 2005
// This file is licensed under the terms of the
// GNU GENERAL PUBLIC LICENSE (GPL) Version 2
//
#include "aps_include"
void main()
{
SQLExecDirect("DROP TABLE pwdata");
SendMessageToPC(GetLastUsedBy(), "Table 'pwdata' deleted.");
// For SQLite
/*
SendMessageToPC(GetLastUsedBy(), "Creating Table 'pwdata' for SQLite...");
SQLExecDirect("CREATE TABLE pwdata (" +
"player varchar(64) NOT NULL default '~'," +
"tag varchar(64) NOT NULL default '~'," +
"name varchar(64) NOT NULL default '~'," +
"val text," +
"expire int(11) default NULL," +
"last timestamp NOT NULL default current_timestamp," +
"PRIMARY KEY (player,tag,name)" +
")");
*/
//For MySQL
SendMessageToPC(GetLastUsedBy(), "Creating Table 'pwdata' for MySQL...");
SQLExecDirect("CREATE TABLE pwdata (" +
"player varchar(64) NOT NULL default '~'," +
"tag varchar(64) NOT NULL default '~'," +
"name varchar(64) NOT NULL default '~'," +
"val text," +
"expire int(11) default NULL," +
"last timestamp NOT NULL default CURRENT_TIMESTAMP," +
"PRIMARY KEY (player,tag,name)" +
") ENGINE=MyISAM DEFAULT CHARSET=latin1;");
// For Access
/*
SendMessageToPC(GetLastUsedBy(), "Creating Table 'pwdata' for Access...");
SQLExecDirect("CREATE TABLE pwdata (" +
"player text(64)," +
"tag text(64)," +
"name text(64)," +
"val memo," +
"expire text(4)," +
"last date)");
*/
SendMessageToPC(GetLastUsedBy(), "Table 'pwdata' created.");
}
I know its more a case of my nwnx doesnt want to connect to the database on my webserver.
I have put all the details in correctly.
Also, when i run nwnx on my local machine, it doesnt create any ... ANY log files resembling the normal ones. (eg it doesnt create any odbc)
Im having to get my friend over msn to test all this for me, while i alter the sql database.
azmodann_nwn
azmodann_Baaleos
Above is the details of my Database and username
74.220.204.131
this is the ip address.... I dont need to use a port number do I? |
|
Back to top |
|
|
PhyrPhly
Joined: 16 Jun 2007 Posts: 25
|
Posted: Fri Sep 07, 2007 16:02 Post subject: Re: Damn... |
|
|
What version of MySQL are you using? If you are using 4.1 or later, I believe you have to set the user password with the "old password" hash.
Try the following on your MySQL commandline.
Quote: | SET PASSWORD FOR 'user'@'host' = OLD_PASSWORD('user_password'); |
where user = azmodann_Baaleos, host = the IP addres or machine name of the NWN server, and user_password is the password for azmodann_Baaleos.
- PhyrPhly |
|
Back to top |
|
|
Baaleos
Joined: 02 Sep 2007 Posts: 830
|
Posted: Fri Sep 07, 2007 16:10 Post subject: |
|
|
Error
SQL query:
SET PASSWORD FOR azmodann_Baaleos@38.96.12.157 = OLD_PASSWORD( '######' )
MySQL said:
#1044 - Access denied for user 'azmodann'@'localhost' to database 'mysql'
When u say "the nwn server" you do mean the game server, opposed to my web server?
If so, then I have put in the game server, the ideal setup I would like is that it communicates from the nwn server, to my website's sql databases. |
|
Back to top |
|
|
PhyrPhly
Joined: 16 Jun 2007 Posts: 25
|
Posted: Fri Sep 07, 2007 17:05 Post subject: Re: |
|
|
Baaleos wrote: | Error
SQL query:
SET PASSWORD FOR azmodann_Baaleos@38.96.12.157 = OLD_PASSWORD( '######' )
MySQL said:
#1044 - Access denied for user 'azmodann'@'localhost' to database 'mysql'
| Sorry... You should be logged into MySQL with an admin account.
Quote: | When u say "the nwn server" you do mean the game server, opposed to my web server?
If so, then I have put in the game server, the ideal setup I would like is that it communicates from the nwn server, to my website's sql databases. | Yes. The 'host' for permissions should be the game server, not the web server.
Example:
GAME SERVER (ip: 1.2.3.4, hostname: earth) [runs NWN Server]
WEB SERVER (ip: 5.6.7.8, hostname: moon) [runs web server and MySQL]
MySQL [user: Joe, password: xyzpdq, game database: nwnx]
Logged into MySQL with an admin account:
Quote: | mysql> show grants for Joe@1.2.3.4;
mysql> show grants for Joe@earth; | If either does not exist for nwnx database, create with admin tool or commandline command below.
Quote: | GRANT ALL PRIVILEGES ON nwnx.* TO 'Joe'@'1.2.3.4' IDENTIFIED BY 'xyzpdq';
GRANT ALL PRIVILEGES ON nwnx.* TO 'Joe'@'earth' IDENTIFIED BY 'xyzpdq'; | If that doesn't get you working, try the old password hash.
Quote: | mysql> SET PASSWORD FOR 'Joe'@'1.2.3.4' = OLD_PASSWORD('xyzpdq');
mysql> SET PASSWORD FOR 'Joe'@'earth' = OLD_PASSWORD('xyzpdq'); |
I hope that helps.
- PhyrPhly |
|
Back to top |
|
|
Eourus
Joined: 20 Sep 2007 Posts: 1
|
Posted: Thu Sep 20, 2007 7:00 Post subject: |
|
|
Bueno yo no hablo inglés asi que os lo pongo en español.
Estoy realizando un mantenimiento para mi módulo de nwn. Por ahora esta en fase beta.
Estoy realizando un tutorial de como lo voy haciendo. Podéis seguirlo en: http://blog.costadelaespada.com
Un saludo y mil perdones por escribir en español |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|