ID:1697919
 
Hello,

I've had this issue once before but I can't recall how I went about fixing it. In short, when I try connecting to a MySQL database of mine using Dantom.DB, I receive the following error:

Database Connection error: The operation completed successfully.


Before anyone asks,
  • yes, MySQL is installed and running on the computer (it's a Windows machine).
  • yes, libmysql.dll (32-bit - straight from the MySQL site) is in not only the same directory as the host files, but in Byond's bin directory and the computer's System directory as well.


Any suggestions? Any and all help is appreciated.
You'll have to show some code here, that error indicates things are working, but I have no idea why your MySQL server would be throwing it as an error.
Well here's the code for the DB itself (actual credentials swapped out):

save_system/mysql
var
DBConnection/dbcon
DBQuery/query

New(sql_host = "localhost", sql_database = "db_name", sql_user = "username", sql_password = "password")
. = ..()

dbcon = new /DBConnection()

var/connected = dbcon.Connect("dbi:mysql:[sql_database]:[sql_host]", sql_user, sql_password)
if(!connected || !dbcon.IsConnected())
world.log << "Database Connection error: [dbcon.ErrorMsg()]"
ready = 0
else
ready = 1
world.log << "LOADED DB"


And to test it, I use this:

client
verb/testDB()
DB = new
I assume the 'DB' variable is type-cast to /save_system/mysql correct? It looks like it should work, gotta be something on MySQL's end bugging up the process.

The only place I see this error code when Googling around is MySQL's backup operations, it definitely shouldn't be appearing on a new connection.

There's an instance I'm finding of the error appearing when your MySQL configuration isn't setup properly. You're positive MySQL is working properly on the localhost server? Are you able to try with a different MySQL server?
In response to Nadrew
Yes, I'm sure it's working. I use the same database to store external information using PHP. It's only when I try to load it in DS that a problem arises.

- New development as I was typing this: So something told me to reboot the host computer to see if maybe it wasn't able to locate the .dll files (for whatever reason), and now it works fine. Sucks that it took so much time away but hey.

I'll leave this here for future reference (this is the second time this problem has stopped me, and the first time it had nothing to do with rebooting, but nonetheless). Thanks again for the assistance, Nadrew.