I need help setting up my database.cfg for kz timer on a dedicated server.

Discussion in 'Support & Feedback' started by Lew, Nov 27, 2016.

  1. Lew

    Lew NEW

    Joined:
    Oct 13, 2016
    Messages:
    13
    Likes Received:
    0
    Ok first of all, I think its my database.cfg that is fucking up because other addons such as RTV and nominate are working so the problem is not source mod or metamod. Now when I bought the server, it came with a mysql and now i am wondering how to set up my database.cfg so all the records and stats are gonna go into it. Also i've read somewhere that kz-timer doesn't work if the database isn't correctly setted up. I am not a pro at all and this is my first time trying to set up a database thanks for your answers, and if needed add me on steam if you feel like it would be easier to explain. ty :)
     
  2. Café

    Café CASUAL

    Joined:
    Jan 21, 2016
    Messages:
    76
    Likes Received:
    32
    Is the kztimer plugin work?
    For your database, you need to change the driver to mysql and change the info for your mysql server, like this:
    Code:
        "kztimer"
        {
              "driver"         "mysql"
              "host"           "(your mysql server ip)"
              "database"       "(your database name)"
              "user"           "(mysql user)"
              "pass"           "(mysql user pass) "
        }
     
  3. Lew

    Lew NEW

    Joined:
    Oct 13, 2016
    Messages:
    13
    Likes Received:
    0
    Ok i did everything like you said but yea kz timer isnt working for some reason. I have the host the user the pass but i was wondering what to put in database. I have a database named db10017 but theres no tables in it also idk what these do. Also in host i have an ip but i saw other settings with localhost into it is that only for local servers AND i have a port for the ip so should i write XX.XXX.XXX.XX: (port) ? picture below. 6bdd15a1b9e8dd3d64007a786c57074a.png ed9dce3b6ee291e09c64001aec3e9c1a.png
     

    Attached Files:

    Last edited: Nov 27, 2016
  4. Café

    Café CASUAL

    Joined:
    Jan 21, 2016
    Messages:
    76
    Likes Received:
    32
    Yup, your database should be db10017. I forgot to say if your port is different from the default one (3306), you need to add it like this:
    Code:
    "kztimer"
    {
    "driver" "mysql"
    "host" "(your mysql server ip)"
    "database" "(your database name)"
    "user" "(mysql user)"
    "pass" "(mysql user pass) "
    "port" "3306"
    }
    
    Can you post your sourcemod error log too? It should be in /csgo/addons/sourcemod/logs. You can post it in pastebin or something like that.

    EDIT: Just for you know, you don't need to create any tables, the plugin create these automatically.
     
  5. Lew

    Lew NEW

    Joined:
    Oct 13, 2016
    Messages:
    13
    Likes Received:
    0
    Ok so i goes like that : http://pastebin.com/pAMahKrz
    I think if i manage the database to work the kz timer pluging will also work I attached the whole file but most of it is the same thing and the rest is talking about default database not being found.
     

    Attached Files:

    Last edited: Nov 28, 2016
  6. Café

    Café CASUAL

    Joined:
    Jan 21, 2016
    Messages:
    76
    Likes Received:
    32
    This line tell us that it can't found the kztimer config on your database.cfg file.
    Code:
    L 11/27/2016 - 20:02:48: [SM] Exception reported: [KZTimer] Unable to connect to database (Configuration "kztimer" not found)
    You sure you set it up correctly? It should look like this:
    Code:
    "Databases"
    {
        "driver_default"        "mysql"
     
        // When specifying "host", you may use an IP address, a hostname, or a socket file path
     
        "default"
        {
            "driver"            "default"
            "host"                "localhost"
            "database"            "sourcemod"
            "user"                "root"
            "pass"                ""
            //"timeout"            "0"
            //"port"            "0"
        }
     
        "storage-local"
        {
            "driver"            "sqlite"
            "database"            "sourcemod-local"
        }
    
        "clientprefs"
        {
            "driver"            "sqlite"
            "host"                "localhost"
            "database"            "clientprefs-sqlite"
            "user"                "root"
            "pass"                ""
            //"timeout"            "0"
            //"port"            "0"
        }
        "kztimer"
        {
              "driver"         "mysql"
              "host"           "127.0.0.1" // Keep in mind that I am hosting this mysql server on the same server of my CSGO server, so thats why i'm using this IP.
              "database"       "**********"
              "user"           "**********"
              "pass"           "**********"
        }
    }
    
    and the database.cfg file need to go into /csgo/addons/sourcemod/configs

    EDIT:Just found out the new update fucked everything. You probably gonna have to update sourcemod.
     
    Last edited: Nov 29, 2016
  7. Lew

    Lew NEW

    Joined:
    Oct 13, 2016
    Messages:
    13
    Likes Received:
    0
    ok I updated sourcemod but i have my kz timer the exact same as you (different host) still not working :[ what can i do now ? get a new mysql server and see if it works ?
     
  8. Café

    Café CASUAL

    Joined:
    Jan 21, 2016
    Messages:
    76
    Likes Received:
    32
    Could you post your database.cfg (without any of your mysql info ofc)
     
  9. Lew

    Lew NEW

    Joined:
    Oct 13, 2016
    Messages:
    13
    Likes Received:
    0
    Code:
    "Databases"
    {
        "driver_default"        "mysql"
        // When specifying "host", you may use an IP address, a hostname, or a socket file path
        "default"
        {
            "driver"            "default"
            "host"                "localhost"
            "database"            "sourcemod"
            "user"                "root"
            "pass"                ""
            //"timeout"            "0"
            //"port"            "0"
        }
        "storage-local"
        {
            "driver"            "sqlite"
            "database"            "sourcemod-local"
        }
    
        "clientprefs"
        {
            "driver"            "sqlite"
            "host"                "localhost"
            "database"            "clientprefs-sqlite"
            "user"                "root"
            "pass"                ""
            //"timeout"            "0"
            //"port"            "0"
        }
       
        "kztimer"
        {
            "driver"         "mysql"
            "host"           "*****"
            "database"       "*****"
            "user"           "*****"
            "pass"           "*****"
        }
    }
    
     
  10. Café

    Café CASUAL

    Joined:
    Jan 21, 2016
    Messages:
    76
    Likes Received:
    32
    You forgot to add the port on your configuration, but I assume your using the default one. If by any chance your mysql server is running on the same dedicated server for your CSGO server? If so, maybe your hosting provider only granted access to your local ip and you will need to put 127.0.0.1 on your kztimer host. But i'm not 100% sure about this.
    For your admin-sql-prefetch.smx error, the plugin try to connect to the "default" config on your database.cfg. Since it use mysql,(because the driver_default is mysql), the info by default is incorrect. You can change it to sqlite for now to bypass this error.
    Code:
    "default"
    {
    "driver" "sqlite"
    "host" "localhost"
    "database" "sourcemod"
    "user" "root"
    "pass" ""
    //"timeout" "0"
    //"port" "0"
    }
    
     
  11. Lew

    Lew NEW

    Joined:
    Oct 13, 2016
    Messages:
    13
    Likes Received:
    0
    Ok i'll try this I'll keep you updated
     
  12. Lew

    Lew NEW

    Joined:
    Oct 13, 2016
    Messages:
    13
    Likes Received:
    0
    Code:
    L 11/29/2016 - 19:19:03: SourceMod error session started
    L 11/29/2016 - 19:19:03: Info (map "de_dust2") (file "errors_20161129.log")
    L 11/29/2016 - 19:19:03: [SM] Unable to load extension "cleaner.ext": Failed to find signature. Please contact the author.
    L 11/29/2016 - 19:19:04: [SM] Unable to load extension "dbi.mysql.ext": libz.so.1: cannot open shared object file: No such file or directory
    L 11/29/2016 - 19:19:04: [SM] Exception reported: [KZTimer] Unable to connect to database (Driver "mysql" not found)
    L 11/29/2016 - 19:19:04: [SM] Blaming: KZTimerGlobal.smx
    L 11/29/2016 - 19:19:04: [SM] Call stack trace:
    L 11/29/2016 - 19:19:04: [SM]   [0] SetFailState
    L 11/29/2016 - 19:19:04: [SM]   [1] Line 337, kztimerGlobal/sql.sp::db_setupDatabase
    L 11/29/2016 - 19:19:04: [SM]   [2] Line 837, F:\csgo-ds\server01\csgo\addons\sourcemod\scripting\KZTimerGlobal.sp::OnPluginStart
    L 11/29/2016 - 19:19:04: [SM] Unable to load plugin "KZTimerGlobal.smx": Error detected in plugin startup (see error logs)
    L 11/29/2016 - 19:19:04: [admin-sql-prefetch.smx] FetchOverrides() query failed: SELECT type, name, flags FROM sm_overrides
    L 11/29/2016 - 19:19:04: [admin-sql-prefetch.smx] Query error: no such table: sm_overrides
    L 11/29/2016 - 19:19:04: [admin-sql-prefetch.smx] FetchGroups() query failed: SELECT flags, name, immunity_level FROM sm_groups
    L 11/29/2016 - 19:19:04: [admin-sql-prefetch.smx] Query error: no such table: sm_groups
    L 11/29/2016 - 19:19:04: [admin-sql-prefetch.smx] FetchUsers() query failed: SELECT id, authtype, identity, password, flags, name, immunity FROM sm_admins
    L 11/29/2016 - 19:19:04: [admin-sql-prefetch.smx] Query error: no such table: sm_admins
    L 11/29/2016 - 19:19:15: Error log file session closed.
    L 11/29/2016 - 19:19:15: SourceMod error session started
    L 11/29/2016 - 19:19:15: Info (map "de_dust2") (file "errors_20161129.log")
    L 11/29/2016 - 19:19:15: [admin-sql-prefetch.smx] FetchOverrides() query failed: SELECT type, name, flags FROM sm_overrides
    L 11/29/2016 - 19:19:15: [admin-sql-prefetch.smx] Query error: no such table: sm_overrides
    L 11/29/2016 - 19:19:15: [admin-sql-prefetch.smx] FetchGroups() query failed: SELECT flags, name, immunity_level FROM sm_groups
    L 11/29/2016 - 19:19:15: [admin-sql-prefetch.smx] Query error: no such table: sm_groups
    L 11/29/2016 - 19:19:15: [admin-sql-prefetch.smx] FetchUsers() query failed: SELECT id, authtype, identity, password, flags, name, immunity FROM sm_admins
    L 11/29/2016 - 19:19:15: [admin-sql-prefetch.smx] Query error: no such table: sm_admins
    L 11/29/2016 - 19:19:16: [admin-sql-threaded.smx] SQL error receiving overrides: no such table: sm_overrides
    L 11/29/2016 - 19:19:16: [admin-sql-threaded.smx] Query dump: SELECT type, name, flags FROM sm_overrides
    L 11/29/2016 - 19:19:16: [admin-sql-threaded.smx] SQL error receiving groups: no such table: sm_groups
    L 11/29/2016 - 19:19:16: [admin-sql-threaded.smx] Query dump: SELECT flags, name, immunity_level FROM sm_groups
    L 11/29/2016 - 19:19:21: [admin-sql-threaded.smx] SQL error receiving user: no such table: sm_admins
    L 11/29/2016 - 19:19:21: [admin-sql-threaded.smx] Query dump: SELECT a.id, a.authtype, a.identity, a.password, a.flags, a.name, COUNT(ag.group_id), immunity FROM sm_admins a LEFT JOIN sm_admins_groups ag ON a.id = ag.admin_id WHERE  (a.authtype = 'ip' AND a.identity = '104.221.69.17') OR (a.authtype = 'name' AND a.
    
     
  13. Café

    Café CASUAL

    Joined:
    Jan 21, 2016
    Messages:
    76
    Likes Received:
    32
    I think the admin-sql-prefetch&threaded error is because you didn't specify any admin on your server.
    Code:
    L 11/29/2016 - 19:19:04: [SM] Exception reported: [KZTimer] Unable to connect to database (Driver "mysql" not found)
    
    I kind of out of ideas with this one. The mysql server is running on the same host as your csgo server right? Same ip and all. Does your mysql server is on the port 3306? Are you using a unmanaged dedicated server with SSH access?
     
  14. PTKFGS!?

    PTKFGS!? SCRUB

    Joined:
    Mar 15, 2016
    Messages:
    40
    Likes Received:
    23
    I don't know sourcemod, metamod nor KZTimerGlobal very well. But in your log I can see :
    I guess someone who knows what he's talking about could tell you if this the blocking part or not.

    Not sure about first line error, but the second one looks a lot like https://forums.alliedmods.net/showthread.php?t=101425
    The command
    Code:
    ldd -d -r addons/sourcemod/extensions/dbi.mysql.ext.so
    confirms libz.so.1 is missing in the link above. Judging by your error message, I assume the command would give you the same result (libz.so.1 missing)
    The user proceeds to install it using apt-get and his problem is solved.

    If you understand what you're doing, and assuming your servers is running Debian/Ubuntu, I suggest you give a try to :

    Code:
    (sudo) apt-get install lib32z1
     
  15. Lew

    Lew NEW

    Joined:
    Oct 13, 2016
    Messages:
    13
    Likes Received:
    0
    I barely know what i am doing, but i know the mysql server is on debian for the game server idk if you can tell me where to input the command line maybe i will be able to figure it out or smth. ty :)

    no the ip is not the same and the port is the default one and for the SSH access i really dont know how do i check also would it make a difference ? ty :)
     
  16. Café

    Café CASUAL

    Joined:
    Jan 21, 2016
    Messages:
    76
    Likes Received:
    32
    Did you fix your problem?
    Like @PTKFGS!? said, maybe it may come from your hosting provider who didn't install the mysql driver.
     

Share This Page