world/New()
..()
Connect()
var/DEF_CUR = 0
var/DB_SERVER = "localhost" // This is the location of your MySQL server (localhost is USUALLY fine)
var/DB_PORT = 3306 // This is the port your MySQL server is running on (3306 is the default)
var/DB_USER = "" //User name
var/DB_PASS = "" //Passworld
var/DB_DB = "" //Database name
var/DB_DBI = "dbi:mysql:[DB_DB]:[DB_SERVER]:[DB_PORT]" //DBI stuff
var/_db_con = 0
proc/Connect()
warning("Attempting db connection: [DB_DBI],[DB_USER],[DB_PASS],[DEF_CUR]")
. = _dm_db_connect(_db_con,DB_DBI,DB_USER,DB_PASS,DEF_CUR,null)
warning("Result = |[.]|, _db_con = |[_db_con]|")
warning("Is connected = |[IsConnected()]|")
warning("Possible error = |[ErrorMsg()]|")
proc/IsConnected()
var/success = _dm_db_is_connected(_db_con)
return success
proc/ErrorMsg() return _dm_db_error_msg(_db_con)
proc/warning(var/message)
world.log << "## WARNING: [message]"
Problem description:
I'm trying to set up an MySQL database behind my project.
However byond does not seem to want to connect.
I'm using the latest version XAMPP to host the database on a windows 8.1 machine.
The database is hosted locally and reachable by http://localhost/phpmyadmin/
As well as by MySQL Workbench. I can read/write the database with a user that has ALL PRIVILEGES created via the PHPMyAdmin on MySQL Workbench. However when I use the same user data to connect with byond it returns the following (* for sensitive info):
World opened on network port 3333.
## WARNING: Attempting db connection: dbi:mysql:feedback:localhost:*****,******,*******,0
## WARNING: Result = ||, _db_con = |0|
## WARNING: Is connected = ||
## WARNING: Possible error = ||
BYOND hub reports port 3333 can be reached by players.
If somebody can explain to me how Byond and MySQL work together and how to generate usable feedback that would be very helpfull.
EDIT: I do have libmysql.dll in the project root folder.