Err, where does libmySQL.dll go? In /orangebox? And does it work on 64bit windows.
Err, where does libmySQL.dll go? In /orangebox? And does it work on 64bit windows.
For local server -> x:\<steam install>\<steamapps>\<username>\<garrysmod>
For dedi server -> x:\<steam install>\<Steam HLDS>\<orangebox>
I put it in "For dedi server -> x:\<steam install>\<Steam HLDS>\<orangebox> " and it still wont load.
I'm having the same problem I believe.
What's the exact error?
Edited:
Same question
error loading module 'mysqloo' from file 'filepath\gmsv_mysqloo.dll: system error 14001
Did you also copied both, gmcl_mysqloo.dll and gmsv_mysqloo.dll into x:\<steam install>\<Steam HLDS>\<orangebox>\<garrysmod>\<lua>\<includes>\<mo dules> ?
Well gmcl for client wised, and sv for server wised
Yes. My dedicated server is running a 64 bit version of windows. I think that's the problem.
Same error and I also have 64bit windows.
Ah, forgot to ask that.
Yeah i'm not sure, it could be cause of 64 bit version, think 32 is only supported by now.
Maybe someone else can respond to this issue.
Sorry that I couldn't help
Edited:
Ditto for you
SRCDS runs in 32bit mode so.
I'm not all that familiar into 32 or 64 versions, but I think its the windows of reading the dll file, even if the srcds runs in 32 to, else my instructions should have worked
I know how to install the module, I'm positive this is because of a 64 bit configuration. Anybody know how I can remedy this?
Being 64 bit should not matter in this situation (Do correct me if I am wrong)
Make sure you are placing the modules in the correct place and have the lib's installed.
He only compiled it for 32bit windows. Basically libmySQL exists in 64bit. Just need the other 2 DLLs recompiled.
EDIT:
I found a work around. Instead of recompiling it, just install the 32bit visual libraries.
http://www.microsoft.com/downloads/d...displaylang=en
Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
I keep getting this error when trying to connect to the database...
Edit: fixed :D
Cannot connect to my MySQL server at all, getting "Connection Failed" and "MySQL server has gone away!" errors. I can connect fine via a remote MySQL client but not through your module, using the same connection details.
Yeah.. The module is a little bugged.. It gave me a "Connected to database" even though I forgot to start WampServer.. and it refuse to connect to my mysql database (on my pc..) but works fine for my external webhost..
I'm not even sure how to work this crap.
So I thought the modules was broken.
But seems that no data is returned to the server console after you run it, and after you call a function trought lua_run
Data is only shown in console when someone is on the server.
Can we get a fix on this bug?
Also does this mean we can't get data from a query if no people are on the server?
Can anyone clear this up?
Is there a possibility for dylib?
libmySQL.dll, there isn't one for Linux? Will this still work?
I'm having a little trouble with compatibility here. I have a script that works perfectly using the Windows version but while attempting to use it on Linux it fails silently while querying. Anybody knows a fix to this?
Are you positive that the module is loaded and there is a player in the server?
This module doesn't work until the think hook starts, any queries which have been ran before this will be pushed through at this time.
You need libmysql 16.
libmysqlclient and libmysql.0.16 or other files of similar name are the same thing and should just be created with a symlink to the original file which you downloaded.
http://dev.mysql.com/downloads/connector/c/
If you don't know how to use symlinks yet, go out and look up some tutorials, they are quite powerful and can make many tasks ridiculously easy.
slayer i love you <3
I'm absolutely certain that the only difference between the two servers was that one was using Linux. It's the exact same code using the same version of the module on the same map.
andy
Can you please add a "mysql_num_rows($res)" style function??? or is there a way of doing this in lua??
I saw you left the flag parameters on the connection open so I tried enabled multiquery. 1 << 16 I think the value was.
While it does run correctly, the module does not handle the returned tables correctly I think.
At least I was only seeing the result set of the first query.
It would be nice if support for multiple queries was added.
The CLIENT_MULTI_STATEMENTS flag that is.
For now I'm stuck daisy chaining queries together with waits in between them.
I'm having some problems... I can't get "Connected" to print :saddowns:
No errors, only the version (7).
--init.lua require("mysqloo") AddCSLuaFile( "cl_init.lua" ) AddCSLuaFile( "shared.lua" ) include( 'shared.lua' ) print(mysqloo.VERSION) function GM:PlayerInitialSpawn(ply) print(ply:GetName(),"spawned for the first time"); --Test MySql --Todo end function GM:Initialize() print("Starting Init/init.lua"); databaseObject = mysqloo.connect("localhost", "root", "", "testdb", 3306) databaseObject.onConnected = (function(db) print("Connected!") end); databaseObject:connect() end
Edit, I re-looked through this thread and saw Database:onConnectionFailed, and it'll probably fix my problem.
Edit, it told me what happened wrong:(2) - Connection was not successful or has failed
Edit, DERP. ACCOUNT WAS LOCKED TO LOCALHOST. Created new user and allowed to any host (will change later to actual server ip)
Though it would've been nice to know that 'Login failed' instead of just 'Connection was not successful or has failed'
How does this manage connections?
Once you connect does it auto-connect/disconnect?
What if the connection is closed by the remote host?
Could you add a function like query:num_rows() similar to php's mysql_num_rows($result)
query:setOption(1, true) query:setOption(2, false) query.onSuccess = function() print("There are "..#query:GetData().." rows in this query.") end
That would work, although you could keep a variable with onData and check it at onSuccess because of lua's limit of table indexes. But you most likely wouldn't ever need to do a query with 1000+ rows of data.
You could also use Table.Countbut using numeric indexes would be much better for doing this.
Having a function to return the rows would probably be nice though.
Yer, can you maby put more infomation in this. Like step by step, as i can not get this to work with linux.
What's the best way to keep the DB alive using this? It gives that "MySQL server has gone away" error and I want it to be connected at all times.
I think what you were trying to say is...
to count the number of rows in a table inside your Query you write this
query("SELECT count(*) FROM database")
which will return a int with the number of rows.
Edited:
I am very sorry for the double post but my first post was an answer to a question, this post however is a question.
In my code i connect the database fine, no errors. It then also is able to send data to the database.
databaseObject:query("INSERT INTO evolve_data (userid,nick,steamid,ipaddress,playtime,lastjoin,rank,banned) VALUES ('"..ply:UniqueID().."', '"..ply:Nick().."','"..ply:SteamID().."', '"..ply:IPAddress().."', 0, "..os.time()..", 'guest',0)")
That all works fine but later on when i try to set data
It gives me the errorfunction _R.Player:SetProperty( id, value ) property = string.lower(id) local query = databaseObject:query("UPDATE evolve_data SET "..property.." = '"..value.."' WHERE userid = '"..self:UniqueID().."'") query.onData = function(Q,D) print("Success in Set Property") end query.onError = function(Q,E) print("Failure in Set Property") print(E) end query:start() end
"MySQL server has gone away"
Is there a fix to this?
I know that i can not have this happen if i connect to the database every time i need to query, but wouldnt it be better to just have the module connect to the db everytime it needs to query?
I was looking at the source code, this is really easy to fix with just 1 line added to the .dll, i did this and tried to compile, but instead of giving me 2 .dll like what comes with the addon it only gave me one. I tried renaming them to gmsv_ and gmcl_ but that didnt work...
Thanks!
So, does this module still works "correctly" or what?
yes
Why wouldn't it?
It works except for some reason it kills the connection to the database every few minutes forcing you to reconnect to it. Which is an annoying son of a female dog.
That's a problem with your database configuration, not the module itself.