MU Soapbox

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Muxify
    • Mustard

    Enabling SQL on TinyMUX

    MU Questions & Requests
    mux sql tinymux
    3
    13
    952
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Highfalutin
      Highfalutin last edited by Highfalutin

      Because I clearly haven't established myself as enough of an idiot today, now begins the struggle to understand how to enable SQL on TinyMux.

      I'm looking at this:
      https://wiki.tinymux.org/index.php/SQL

      ...and it reads like Greek to me. "Change @query so that it calls sqlmaster instead", for example - What does that mean in practice? I looked at help @query and I see that there's a syntax example for calling a dbref, but not a sql database. What would the syntax look like for that? Do I need to run ./configure with any specific settings, and if so, what are they?

      Apologies in advance for all the stupid questions! New to MUX, but eager to get deeper into it.

      skew 1 Reply Last reply Reply Quote 0
      • Ganymede
        Ganymede Admin last edited by

        You're not an idiot.

        These inquiries are why the sub-forum exists, and I'm delighted that it is being used.

        “It is better to live doing the things that you like. It is foolish to live within this dream of a world seeing unpleasantness and doing only things that you do not like.” -- Yamamoto Tsunetomo.

        1 Reply Last reply Reply Quote 2
        • skew
          skew @Highfalutin last edited by

          @highfalutin Hi!

          So, TinyMUX has two ways to use SQL. One is @query. "We" don't really use that much. the other is the sql() command. To check your SQL connection, use th sql( select 1 ). What response do you get?

          Setting up SQL requires you to actually specify that option when you're, uh, building? the thingy. I suck at Linux, sorry. When you run the actual command to install TinyMUX, there's a --sql-inline or something option you append to it. If the above command doesn't work, that's what you need. ChimeMUX checks if you have SQL automatically, but the standard BrazilMUX does not. So... Run the above command. Let me know if it works. If not, I'll dig up the correct command line.

          Highfalutin 1 Reply Last reply Reply Quote 1
          • Highfalutin
            Highfalutin @skew last edited by

            @skew said in Enabling SQL on TinyMUX:

            th sql( select 1 )

            Damn. I get this:

            #-1 FUNCTION (SQL) NOT FOUND

            (And thank you!)

            skew 1 Reply Last reply Reply Quote 0
            • skew
              skew @Highfalutin last edited by

              @highfalutin said in Enabling SQL on TinyMUX:

              @skew said in Enabling SQL on TinyMUX:

              th sql( select 1 )

              Damn. I get this:

              #-1 FUNCTION (SQL) NOT FOUND

              (And thank you!)

              Are you using Brazil's latest release? Or ChimeMux? I noticed you linked to lashtear's GitHub elsewhere.

              Highfalutin 1 Reply Last reply Reply Quote 0
              • Highfalutin
                Highfalutin @skew last edited by Highfalutin

                @skew

                I'm not 100% sure, which is pretty embarrassing!

                I used this guide:
                https://secure.thirdhosting.com/knowledgebase/12/Install-Guide-for-TinyMUX-Codebase.html

                For this:
                ftp://ftp.tinymux.org/tinymux-2.10/14/mux-2.10.1.14.unix.tar.gz

                When I check version() I get this:

                MUX 2.10.1.14 #3 [2017-AUG-05]

                skew 1 Reply Last reply Reply Quote 0
                • skew
                  skew @Highfalutin last edited by

                  @highfalutin I much prefer ChimeMUX because it's possible to install it. And prefer Rhost over all of it, because omg so much easier. But enough whining, right?

                  https://github.com/sean-brandt/tinymux/blob/master/mux/SQL

                  Some actual instructions. Go down to "In-Line/Synchronous SQL" and that should be what you need. When you do the actual ./configure, you add those options on. As it says, if your MySQL is not in the right spot, if your user doesn't have the correct rights, etc, you'll need to deal with that. BUT... that'll do it.

                  Doing the configure and rebuilding TinyMUX... shouldn't delete anything. But I'd back up first, just to be sure.

                  Highfalutin 1 Reply Last reply Reply Quote 2
                  • Highfalutin
                    Highfalutin @skew last edited by

                    @skew You're a life-saver. Thank you, it's much appreciated.

                    1 Reply Last reply Reply Quote 0
                    • Highfalutin
                      Highfalutin last edited by Highfalutin

                      Progress!

                      In src folder:

                      ./configure --enable-inlinesql --enable-realitylvls --enable-stubslave
                      make depend
                      make
                      

                      In the src/modules folder:

                      ./configure
                      make
                      

                      Added to netmux.conf:

                      module sqlproxy
                      module sqlslave
                      
                      sql_database username_muxtest
                      sql_server localhost
                      sql_user username_muxtest
                      sql_password passwordishere
                      

                      Then @restarted in the game.

                      I checked the logfile and saw this:

                      2019.0119:011848 Eventide INI/LOAD : Couldn’t create interface to Query Server.

                      Checked the function to see if it worked anyway:

                      think [sql()]
                      #-1 FUNCTION (SQL) NOT FOUND
                      
                      @query
                      Query server is not available.
                      

                      Everything seems to be in the right spot:

                      checking for location of SQL header files... /usr/include/mysql
                      checking for location of SQL library files... /usr/lib/mysql

                      I think I must be missing something... Does anything stick out?

                      1 Reply Last reply Reply Quote 0
                      • Highfalutin
                        Highfalutin last edited by Highfalutin

                        Got it working with asychronous SQL, though I'm nervous that it doesn't provide the sql() function.

                        Just in case anyone else needs it at some point:

                        ./configure --enable-stubslave --with-mysql-include=/usr/local/mysql/include --with-mysql-libs=/usr/local/mysql/lib --enable-realitylvls
                        make depend
                        make
                        
                        Add to netmux.conf:
                        
                        module sqlproxy
                        module sqlslave local
                        
                        sql_database username_muxtest
                        sql_server localhost
                        sql_user username_muxtest
                        sql_password passwordhere
                        

                        Going to keep fiddling with inline.

                        1 Reply Last reply Reply Quote 0
                        • Highfalutin
                          Highfalutin last edited by

                          Okay... I think the issue might be the location of the sql libaries, or something. With inline enabled, I get this on make depend:

                          makefunctions.cpp:26:19: error: mysql.h: No such file or directory
                          game.cpp:30:19: error: mysql.h: No such file or directory
                          

                          Makefile:

                          INLINESQL         = -DINLINESQL
                          INLINESQL_LIBS    = -L/usr/local/mysql/lib -lmysqlclient -lz
                          INLINESQL_INCLUDE = -I/usr/local/mysql/include
                          

                          So! Is there anyone else on here who uses tinymux with SQL, and is hosted on Third Generation Hosting? Any chance you could tell me where the correct path?

                          Highfalutin 1 Reply Last reply Reply Quote 0
                          • Highfalutin
                            Highfalutin @Highfalutin last edited by

                            AHHH! I GOT IT.

                            Correct paths:

                            INLINESQL_LIBS    = -L/usr/lib/mysql -lmysqlclient -lz
                            INLINESQL_INCLUDE = -I/usr/include/mysql
                            

                            I have never seen a more beautiful error message:

                            think [sql()]
                            #-1 FUNCTION (SQL) EXPECTS BETWEEN 1 AND 3 ARGUMENTS
                            
                            skew 1 Reply Last reply Reply Quote 1
                            • skew
                              skew @Highfalutin last edited by

                              @highfalutin we use the inline, and really it's the only one you need. So, glad it's working!

                              1 Reply Last reply Reply Quote 1
                              • 1 / 1
                              • First post
                                Last post