Announcement

Collapse
No announcement yet.

Database Setup

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Database Setup

    Hey, I'm back again with a new video that hopefully helps folks get their database connection initialized. Enjoy.

    #2
    Hey buddy, you don't show in your video where and how to get the mariadb dll! Can you send me it or show me how to create it please i'm lost

    Comment


      #3
      Originally posted by ZepTepProd View Post
      Hey buddy, you don't show in your video where and how to get the mariadb dll! Can you send me it or show me how to create it please i'm lost
      The mariadb client libs are in your server installation by default. Check the plugins directory. You don't need to do anything other than make sure "mariadb" is in your server_config.json under the plugins section. If you're talking about installing the actual MariaDB database itself, then yeah that's beyond the scope of this video beyond the brief look I gave at the website near the beginning. If that's what you're looking for: https://mariadb.org/

      Comment


        #4
        Hello I have error : bad argument #2 to 'mariadb_async_query' (expected string-like argument)

        [LUA]function cmd_heure(player)
        local query = mariadb_prepare(SQL, "SELECT CURRENT_TIMESTAMP()")
        mariadb_async_query(SQL, query , cb_gettimestamp, player)
        end
        AddCommand("heure", cmd_heure)
        function cb_gettimestamp()
        local timestamp = mariadb_get_value_index(1, 1)
        AddPlayerChat(player, "Il est : " .. timestamp)
        end[/LUA]

        Comment


          #5
          Originally posted by KeyTur View Post
          Hello I have error : bad argument #2 to 'mariadb_async_query' (expected string-like argument)

          [LUA]function cmd_heure(player)
          local query = mariadb_prepare(SQL, "SELECT CURRENT_TIMESTAMP()")
          mariadb_async_query(SQL, query , cb_gettimestamp, player)
          end
          AddCommand("heure", cmd_heure)
          function cb_gettimestamp()
          local timestamp = mariadb_get_value_index(1, 1)
          AddPlayerChat(player, "Il est : " .. timestamp)
          end[/LUA]
          Looks like mariadb_prepare returned a false boolean. Check the mariadb_log, maybe your connection isn't setup properly.

          Comment


          • KeyTur
            KeyTur commented
            Editing a comment
            CONSOLE : [2020-07-31 19:06:04] [script] Base de donné connecter a : localhost

            SCRIPT :
            if (SQL ~= nil) then
            print("Base de donné connecter a : " .. sql_host)

            Yet in the console it gives me no worries

          #6
          Originally posted by Talos View Post

          Looks like mariadb_prepare returned a false boolean. Check the mariadb_log, maybe your connection isn't setup properly.
          [2020-07-31 11:37:43.671] [mariadb] [error] Connection::Connection - establishing connection to MariaDB database failed: #1045
          Yes Thanks

          Comment

          Working...
          X