Does this not work on Linux? I know that there's a binary for it, but it doesn't load. There's also no libthing that goes in orangebox
Edited:
No libMYSQL.dll in the Linux one, that's it. Module won't load without it I believe
Does this not work on Linux? I know that there's a binary for it, but it doesn't load. There's also no libthing that goes in orangebox
Edited:
No libMYSQL.dll in the Linux one, that's it. Module won't load without it I believe
I think you need to use libmysql.so for Linux.
Edited:
It should be in /usr/lib/mysql/ .
Look for my posts a few pages back. They tell you how to get it working for linux. Really should be in the OP, but whatever.
Here's the ones from my server if anyone needs them:
http://82.192.94.157/f/libmysql-linux.zip
Lawl. Just the IP Number with No Domain, Obvious Virus.
I do NOT RECOMMEND DOWNLOADING THIS.
http://192.168.0.1
Lawl Just the IP number with no domain, Obvious Virus
Now how am I gonna setup my router!?
It's a zip containing .so files. What's so virusy about that?
I'm feeling genourous, if you think it's a virus then use this alternative link: http://storage.gmodsvns.net/libmysql-linux.zip
subdomain = virus
get reel domaen then i download -.-
(User was banned for this post ("Shit posting" - Swebonny))
I can't understand this, but are you being sarcastic? Kinda hard to tell with text.
Install the MySQL lib with apt-get
Confirming, this works.
PROBLEM!
MySQL server has gone away. Line 59, of Data.
Means your connection died from idling for too long.
Try to either change mysql commandline connect-timeout or get the lua script to reconnect.
see http://www.facepunch.com/threads/933...1#post26221004 for info about changing the timeout at runtime
Now I connected .. but how do I disconnect?
Would setting the connection to nil terminate the connection?
No.
That's a rather good point, not even tmysql has a disconnect...
Yea. I am thinking of designing a php mysql tool for server owners so they can run queries that way and have it highly customized.
wait... wut?
Or you could check if the connection is still alive and if not then reconnect and run the query.
Agreed. Just be sure to check and see if it is doing science and still alive.
Yes, setting the object to nil will close the connection.
AFAIK, the connection will still be open you will just be unable to access it.
If you unreference the object the connection should automatically close.
That was my point. I hadn't tested it though.
And once you are unable to access it the Lua garbage collector will unallocate the connection from memory, and then the connection will be closed.
Indeed. It is interesting to see how many people think of connections as magical gateways that exist outside of normal programming. Network connections are two machines ( or even one, or more than two :O ) that are sending information to each other. If one of those two machines stops sending data, the connection is closed.
AFAIK, mysql gets pings as long as an active connection is open, and closes when it stops getting those pings. When it gets a request for data, it does the query and sends the data back. So idle connections only take up ping-sized bandwidth, and once the pings stop, mysql closes that connection.
So once the mysqloo instance is dropped from memory, the connection dies since it isn't being kept up by the server any more.
Please correct me if I am wrong.
You are all wrong.
As you see the code I ran is to the right.
II first did a netstat
After that I opened the connection
I did anothe netstat and it showed the connection had opened
I then nilled the connection
I performed another netstat and noticed the connection was still open
This proves that nilling the connection dosent close the connection, it just makes you unable to access it.
Garbage collection doesn't run immediately after you nil the connection.
G.collectgarbage![]()
The connection itself is being run in another thread from the lua interface, isn't it?
So actually, nilling the lua interface doesn't kill the connection...
Probably needs a function to kill the connection thread then. Does the connection close when you close gmod?
Edited:
Or this. Try this too =P
When you connect to the database it opens a connection up to the database.
When you assign that to a variable you are able to do SET things to that variable.
If you do not assign it to a variable it will still open, yet the variable will be nil because it was never set.
So if you set the variable and then nil it it will still remain open.
The only way for it to close is if the code tells it to close.
Example.
mysqloo.connect(host,user,pass,db,port) -- That will connect although no variable is assigned mysqloo.connect(host,user,pass,db,port) = nil -- That will connect although no variable is assigned, it is the same as above. conn = mysqloo.connect(host,user,pass,db,port) conn = nil -- That will not close the connection
BTW, I did what you said and it didn't work, as I predicted.
![]()
It must have changed, then. Before it would close with garbage collection.
No matter, there is a database:delete() function for what you're trying to do.
Really? *Checks Code*
Broke my automerge!
According to the source code: https://github.com/andyvincent/Garry...S_Database.cpp
There is a Database:CanDelete function, but no Delete function. Also, there is no lua access to anything regarding deletion...
Edited:
You broke mine!
It would seem that either the binaries or the source code is out of date, then. Either way they're obviously different. Last time I used the precompiled binaries from the OP, I was able to use a database:delete() function.
When was the last time you used the precompiled binaries? I'm using the latest...
Edit:
HURRR... it's :delete(), not :Delete(), and it works...
Lowercase d on the delete. Aaaand, a few weeks ago.
Ninja'd my automerge again D: