logo logo

 Back to main page

The NWNX Community Forum

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Can't connect to mysql

 
Post new topic   Reply to topic    nwnx.org Forum Index -> General Discussion
View previous topic :: View next topic  
Author Message
Beowulf



Joined: 23 Jan 2005
Posts: 4
Location: Austin, TX

PostPosted: Mon Jan 24, 2005 23:22    Post subject: Can't connect to mysql Reply with quote

Okay, I'm sure I'll feel really stupid in a few minutes, but I'll ask anyway. First off, I've run nwnx2 for linux for quite some time with no issues. Now I'm trying to get it running under Windows and am having difficulties getting it to connect to the database. I suspect I may not fully understand how things work in the Windows environment. In linux the code to connect to the mysql server is built-in... you just put your server info in the nwnx2.ini and it connects. Under Windows I've tried the following:

On the initial assumption that the mysql connection code was built-in to nwnx2 I put the following in my NWNX.ini:
Code:

; NWNX2 configuration file
; These are the default values for NWNX2. Values specified on the command
; line take precedence.

[NWNX]
ServerPort = 5121
ModuleName = "TestModule1"
WatchdogProcess = yes
UpdateIntervalProcess = 5
WatchdogGamespy = no
UpdateIntervalGamespy = 20
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 = localhost
user   = nwn
pwd    = nwn-passwd
db     = NWNX

; 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


This failed to work. I get the following error in nwnx.txt:
"* An error occured during OnCreate of odbc"

Additionally, nwnx_odbc.txt has:
"! Error while connecting to database: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified"

So then I thought that maybe nwnx2 needs the mysql odbc driver and a "connection" configured. So I grab the latest mysql odbc driver, install it, and configure a "Connection" that connects succesfully to the database when I click "Test". I changed the mysql section of the NWNX.ini to use the newly configured odbc connection as the "source":
Code:

; Use these five settings for MySQL connections
source = nwnx-mysql
server = localhost
user   = nwn
pwd    = nwn-passwd
db     = NWNX


Unfortunately I get the same errors as before. I don't understand the error message since I do have an ODBC source named "nwnx-mysql" which connects successfully when tested. Is there something else that I am doing wrong? It is probably something obvious that I am overlooking...
_________________
-Beowulf
Back to top
View user's profile Send private message AIM Address
Papillon
x-man


Joined: 28 Dec 2004
Posts: 1060
Location: Germany

PostPosted: Mon Jan 24, 2005 23:42    Post subject: Reply with quote

1) Your first attempt had the correct configuration

2) Get the ODBC2 module. The old one does not support the fancy new stuff.
_________________
Papillon
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
DarkstarsDad



Joined: 17 Jan 2005
Posts: 59
Location: Overland Park, Kansas USA

PostPosted: Mon Jan 24, 2005 23:59    Post subject: source name? Reply with quote

Remember the source name has to be the name you called the db on the odbc driver.
Back to top
View user's profile Send private message
Beowulf



Joined: 23 Jan 2005
Posts: 4
Location: Austin, TX

PostPosted: Tue Jan 25, 2005 0:23    Post subject: Reply with quote

I should have clued in on the "[ODBC2]" in the NWNX.ini file. I had downloaded the "stable" version of the odbc module because I thought that was the safe route to go. Okay, downloading and using the beta odbc2 module worked. Thanks!

Maybe it should be mentioned in the readme or on the downloads that the default NWNX.ini doesn't work with the "stable" odbc module and that new users should use the odbc2 module instead.

Anyway, all looks good now. Thanks again.
_________________
-Beowulf
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> General Discussion All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
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