Fighting with mysql,byond+db (found solution)
|
|
okay so I am trying to get a test box up and running and I am wondering if I am missing something. I fail everytime I try to connect to the database. Yet perl using almost the same dbi string can connect fine. Has anyone else got db working? Heres the test code...
#define DBI "dbi:mysql:test:localhost:3306" #define DB_USER "MY_USER_NAME" #define DB_PASSWORD "MY_PASSWORD" CGI/Topic(href) var/ok var/DBConnection/dbcon = new() ok=dbcon.Connect(DBI,DB_USER,DB_PASSWORD) content_type = "text/html" if(!ok) usr << "failed:[dbcon.ErrorMsg()]!" else usr << "connected!" dbcon.Disconnect() ..()
Yea I know its pretty poor quality code, but I am just trying to test it. What I am wondering is if I am putting in the wrong thing for my_server (I replaced that with localhost). database is right, ports right (checked with netstat -an). user and password are right. I also emerged libdbi + libdbi-drivers. Thought maybe it was a library issue. And finally dbcon.ErrorMsg() returns a null string also, so that wasnt any help. Any thoughts?
MySQL 4.0.22
Byond 341.877
|
i'd have to check into how i did it way back when to be of any more help.