1. Post #201
    Gold Member
    Bubka3's Avatar
    August 2010
    51 Posts
    Err, where does libmySQL.dll go? In /orangebox? And does it work on 64bit windows.
    Reply With Quote Edit / Delete United States Show Events

  2. Post #202
    WaterRatj's Avatar
    May 2010
    119 Posts
    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>
    Reply With Quote Edit / Delete Belgium Show Events

  3. Post #203
    Gold Member
    Bubka3's Avatar
    August 2010
    51 Posts
    I put it in "For dedi server -> x:\<steam install>\<Steam HLDS>\<orangebox> " and it still wont load.
    Reply With Quote Edit / Delete United States Show Events

  4. Post #204
    Namaste's Avatar
    November 2009
    1,962 Posts
    I'm having the same problem I believe.
    Reply With Quote Edit / Delete United States Show Events

  5. Post #205
    WaterRatj's Avatar
    May 2010
    119 Posts
    I put it in "For dedi server -> x:\<steam install>\<Steam HLDS>\<orangebox> " and it still wont load.
    What's the exact error?

    Edited:

    I'm having the same problem I believe.
    Same question
    Reply With Quote Edit / Delete Belgium Show Events

  6. Post #206
    Namaste's Avatar
    November 2009
    1,962 Posts
    error loading module 'mysqloo' from file 'filepath\gmsv_mysqloo.dll: system error 14001
    Reply With Quote Edit / Delete United States Show Events

  7. Post #207
    WaterRatj's Avatar
    May 2010
    119 Posts
    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
    Reply With Quote Edit / Delete Belgium Show Events

  8. Post #208
    Namaste's Avatar
    November 2009
    1,962 Posts
    Yes. My dedicated server is running a 64 bit version of windows. I think that's the problem.
    Reply With Quote Edit / Delete United States Show Events

  9. Post #209
    Gold Member
    Bubka3's Avatar
    August 2010
    51 Posts
    Same error and I also have 64bit windows.
    Reply With Quote Edit / Delete United States Show Events

  10. Post #210
    WaterRatj's Avatar
    May 2010
    119 Posts
    Yes. My dedicated server is running a 64 bit version of windows. I think that's the problem.
    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:

    Same error and I also have 64bit windows.
    Ditto for you
    Reply With Quote Edit / Delete Belgium Show Events

  11. Post #211
    Gold Member
    Bubka3's Avatar
    August 2010
    51 Posts
    SRCDS runs in 32bit mode so.
    Reply With Quote Edit / Delete United States Show Events

  12. Post #212
    WaterRatj's Avatar
    May 2010
    119 Posts
    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
    Reply With Quote Edit / Delete Belgium Show Events

  13. Post #213
    Namaste's Avatar
    November 2009
    1,962 Posts
    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?
    Reply With Quote Edit / Delete United States Show Events

  14. Post #214
    Gold Member
    Adamm's Avatar
    July 2010
    351 Posts
    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.
    Reply With Quote Edit / Delete Australia Show Events Disagree Disagree x 1 (list)

  15. Post #215
    Gold Member
    Bubka3's Avatar
    August 2010
    51 Posts
    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
    Reply With Quote Edit / Delete United States Show Events Winner Winner x 1 (list)

  16. Post #216
    miceiken's Avatar
    September 2008
    181 Posts
    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
    Reply With Quote Edit / Delete Norway Show Events

  17. Post #217
    PROUD BRONY 4LYFE
    Drakehawke's Avatar
    February 2009
    3,312 Posts
    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.
    Reply With Quote Edit / Delete United Kingdom Show Events

  18. Post #218
    Gold Member

    April 2009
    726 Posts
    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..
    Reply With Quote Edit / Delete Denmark Show Events

  19. Post #219
    Crossu88's Avatar
    July 2008
    1,327 Posts
    I'm not even sure how to work this crap.
    Reply With Quote Edit / Delete United States Show Events Dumb Dumb x 1 (list)

  20. Post #220
    WaterRatj's Avatar
    May 2010
    119 Posts
    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?
    Reply With Quote Edit / Delete Belgium Show Events

  21. Post #221
    hansihe's Avatar
    January 2010
    82 Posts
    Is there a possibility for dylib?
    Reply With Quote Edit / Delete Norway Show Events

  22. Post #222
    Gold Banana
    Banana Lord.'s Avatar
    May 2010
    6,429 Posts
    libmySQL.dll, there isn't one for Linux? Will this still work?
    Reply With Quote Edit / Delete United States Show Events

  23. Post #223
    VENEZOLANO
    Big Bang's Avatar
    August 2006
    3,407 Posts
    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?
    Reply With Quote Edit / Delete Venezuela Show Events

  24. Post #224
    Gold Member
    slayer3032's Avatar
    November 2007
    3,393 Posts
    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.

    libmySQL.dll, there isn't one for Linux? Will this still work?
    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.
    Reply With Quote Edit / Delete United States Show Events

  25. Post #225
    Gold Banana
    Banana Lord.'s Avatar
    May 2010
    6,429 Posts
    slayer i love you <3
    Reply With Quote Edit / Delete United States Show Events Optimistic Optimistic x 1 (list)

  26. Post #226
    VENEZOLANO
    Big Bang's Avatar
    August 2006
    3,407 Posts
    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.
    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.
    Reply With Quote Edit / Delete Venezuela Show Events

  27. Post #227
    mbainrot's Avatar
    August 2008
    178 Posts
    andy

    Can you please add a "mysql_num_rows($res)" style function??? or is there a way of doing this in lua??
    Reply With Quote Edit / Delete Australia Show Events

  28. Post #228

    March 2007
    3 Posts
    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.
    Reply With Quote Edit / Delete United States Show Events

  29. Post #229
    cas97's Avatar
    August 2009
    987 Posts
    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'
    Reply With Quote Edit / Delete United States Show Events

  30. Post #230
    mbainrot's Avatar
    August 2008
    178 Posts
    How does this manage connections?

    Once you connect does it auto-connect/disconnect?

    What if the connection is closed by the remote host?
    Reply With Quote Edit / Delete Australia Show Events

  31. Post #231
    cas97's Avatar
    August 2009
    987 Posts
    Could you add a function like query:num_rows() similar to php's mysql_num_rows($result)
    Reply With Quote Edit / Delete United States Show Events

  32. Post #232
    Gold Member
    slayer3032's Avatar
    November 2007
    3,393 Posts
    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.Count but using numeric indexes would be much better for doing this.

    Having a function to return the rows would probably be nice though.
    Reply With Quote Edit / Delete United States Show Events Optimistic Optimistic x 1 (list)

  33. Post #233
    Dennab
    October 2010
    36 Posts
    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.
    Yer, can you maby put more infomation in this. Like step by step, as i can not get this to work with linux.
    Reply With Quote Edit / Delete Australia Show Events

  34. Post #234
    I'm Solo.
    Chief Tiger's Avatar
    April 2010
    467 Posts
    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.
    Reply With Quote Edit / Delete United States Show Events

  35. Post #235
    taste the salty dong
    Remscar's Avatar
    September 2009
    1,821 Posts
    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.Count but using numeric indexes would be much better for doing this.

    Having a function to return the rows would probably be nice though.
    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
    function _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
    
    It gives me the error
    "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!
    Reply With Quote Edit / Delete United States Show Events

  36. Post #236
    Gold Member
    Loures's Avatar
    February 2009
    2,118 Posts
    So, does this module still works "correctly" or what?
    Reply With Quote Edit / Delete Italy Show Events

  37. Post #237
    Lead4u's Avatar
    December 2008
    53 Posts
    So, does this module still work "correctly" or what?
    yes
    Reply With Quote Edit / Delete United States Show Events

  38. Post #238
    MoronYard
    _nonSENSE's Avatar
    May 2010
    1,264 Posts
    So, does this module still works "correctly" or what?
    Why wouldn't it?
    Reply With Quote Edit / Delete Germany Show Events

  39. Post #239
    taste the salty dong
    Remscar's Avatar
    September 2009
    1,821 Posts
    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.
    Reply With Quote Edit / Delete United States Show Events

  40. Post #240
    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.
    Reply With Quote Edit / Delete United Kingdom Show Events