libmysqld.dll - any working example?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • JZ

    libmysqld.dll - any working example?

    Does anybody know any working example of using embedded MySQL library
    for Win32 (libmysqld.dll) ? That example from MySQL manual does not
    work for me. I am looking for Python API to libmysqld.dll.. .

    --
    JZ
  • Joe Francia

    #2
    Re: libmysqld.dll - any working example?

    JZ wrote:[color=blue]
    > Does anybody know any working example of using embedded MySQL library
    > for Win32 (libmysqld.dll) ?That example from MySQL manual does not
    > work for me. I am looking for Python API to libmysqld.dll.. .[/color]

    You may want to consider this, which doesn't require you to ship any
    external DLLs:
    Download MySQL for Python for free. MySQL database connector for Python programming. MySQLdb is a Python DB API-2.0-compliant interface; see PEP-249 for details.


    Joe

    Comment

    • JZ

      #3
      Re: libmysqld.dll - any working example?

      On Wed, 26 Nov 2003 17:31:35 GMT, Joe Francia <usenet@soraia. com>
      wrote:
      [color=blue][color=green]
      >> Does anybody know any working example of using embedded MySQL library
      >> for Win32 (libmysqld.dll) ?That example from MySQL manual does not
      >> work for me. I am looking for Python API to libmysqld.dll.. .[/color]
      >
      >You may want to consider this, which doesn't require you to ship any
      >external DLLs:
      >http://sourceforge.net/projects/mysql-python[/color]

      No, you did not understand me. I know this library and I have been
      using it for a long time. But the problem is I want to move my web
      (pythonic) application to CD and I wanted it to work with MySQL as a
      DLL library. I do not want to install full mysql serwer.
      I know how to use MySQLdb connection for a server, but I do not know
      how to connect to that dll. If MySQLdb can do this I do not know how
      use it. (MySQLdb.Connec t() method has parameters of host, login but
      libmysql.dll do not need such parameters.)

      --
      JZ


      Comment

      • Dennis Lee Bieber

        #4
        Re: libmysqld.dll - any working example?

        JZ fed this fish to the penguins on Wednesday 26 November 2003 03:30 am:
        [color=blue]
        >
        >
        > Does anybody know any working example of using embedded MySQL library
        > for Win32 (libmysqld.dll) ? That example from MySQL manual does not
        > work for me. I am looking for Python API to libmysqld.dll.. .
        >[/color]
        If I understand my book (hmmm, looks like New Riders has been
        swallowed by SAMS and renamed to "Developer' s Library"), that DLL would
        have to be specified to the linker in place of the regular client
        protocol library. If so, to get Python to use it will likely require
        rebuilding the MySQLdb modules changing the linkage option.

        --[color=blue]
        > =============== =============== =============== =============== == <
        > wlfraed@ix.netc om.com | Wulfraed Dennis Lee Bieber KD6MOG <
        > wulfraed@dm.net | Bestiaria Support Staff <
        > =============== =============== =============== =============== == <
        > Bestiaria Home Page: http://www.beastie.dm.net/ <
        > Home Page: http://www.dm.net/~wulfraed/ <[/color]

        Comment

        • JZ

          #5
          Re: libmysqld.dll - any working example?

          On Sat, 29 Nov 2003 01:00:34 GMT, Dennis Lee Bieber
          <wlfraed@ix.net com.com> wrote:
          [color=blue][color=green]
          >> Does anybody know any working example of using embedded MySQL library
          >> for Win32 (libmysqld.dll) ? That example from MySQL manual does not
          >> work for me. I am looking for Python API to libmysqld.dll.. .
          >>[/color]
          > If I understand my book (hmmm, looks like New Riders has been
          >swallowed by SAMS and renamed to "Developer' s Library"), that DLL would
          >have to be specified to the linker in place of the regular client
          >protocol library. If so, to get Python to use it will likely require
          >rebuilding the MySQLdb modules changing the linkage option.[/color]

          Do you know how to rebuild this module using Visual Studio 7 instead
          of v6? Is it possible?

          --
          JZ

          Comment

          • JZ

            #6
            Re: libmysqld.dll - any working example?

            On Sat, 29 Nov 2003 01:00:34 GMT, Dennis Lee Bieber
            <wlfraed@ix.net com.com> wrote:
            [color=blue][color=green]
            >> Does anybody know any working example of using embedded MySQL library
            >> for Win32 (libmysqld.dll) ? That example from MySQL manual does not
            >> work for me. I am looking for Python API to libmysqld.dll.. .
            >>[/color]
            > If I understand my book (hmmm, looks like New Riders has been
            >swallowed by SAMS and renamed to "Developer' s Library"), that DLL would
            >have to be specified to the linker in place of the regular client
            >protocol library. If so, to get Python to use it will likely require
            >rebuilding the MySQLdb modules changing the linkage option.[/color]

            I recompiled MySQLdb but I still do not know how to connect to embed
            server... :( MySQL.Connect(h ost=...)???? There is no example nor
            explanation. Not at all.

            --
            JZ

            Comment

            • Joe Francia

              #7
              Re: libmysqld.dll - any working example?

              JZ wrote:[color=blue]
              > On Sat, 29 Nov 2003 01:00:34 GMT, Dennis Lee Bieber
              > <wlfraed@ix.net com.com> wrote:
              >
              >[color=green][color=darkred]
              >>>Does anybody know any working example of using embedded MySQL library
              >>>for Win32 (libmysqld.dll) ? That example from MySQL manual does not
              >>>work for me. I am looking for Python API to libmysqld.dll.. .
              >>>[/color]
              >>
              >> If I understand my book (hmmm, looks like New Riders has been
              >>swallowed by SAMS and renamed to "Developer' s Library"), that DLL would
              >>have to be specified to the linker in place of the regular client
              >>protocol library. If so, to get Python to use it will likely require
              >>rebuilding the MySQLdb modules changing the linkage option.[/color]
              >
              >
              > Do you know how to rebuild this module using Visual Studio 7 instead
              > of v6? Is it possible?
              >
              > --
              > JZ[/color]

              Unless you're totally married to MySQL, you may want to consider using
              one of the embeddable databases for Python, such as Sleepycat's
              Berkeley, Metakit, PySQLite, Kinterbase, etc. I've used Berkeley,
              Metakit and PySQLite, and they're all very good, each serving somewhat
              different needs. Shouldn't be too much effort to pull the data out of
              MySQL and into something else.

              Peace,
              Joe

              Comment

              • JZ

                #8
                Re: libmysqld.dll - any working example?

                On Sat, 29 Nov 2003 08:40:56 GMT, Joe Francia <usenet@soraia. com>
                wrote:

                [color=blue]
                >Unless you're totally married to MySQL, you may want to consider using
                >one of the embeddable databases for Python, such as Sleepycat's
                >Berkeley, Metakit, PySQLite, Kinterbase, etc. I've used Berkeley,
                >Metakit and PySQLite, and they're all very good, each serving somewhat
                >different needs. Shouldn't be too much effort to pull the data out of
                >MySQL and into something else.[/color]

                I do not want to use other database because my application *have to*
                work in full mysql server *and* (with _very_ little effort) with embed
                sql *without changing any sql queries*. It is multiplatform
                application (MySQL/Linux & MSSQL2k/Win32) I thought about SQlite, but
                it is no compatible with some queries. and I do not want to parse them
                with regular expressions.

                I checked mysql.h and I found the following piece of code:

                /*
                Set up and bring down the server; to ensure that applications will
                work when linked against either the standard client library or the
                embedded server library, these functions should be called.
                */
                int STDCALL mysql_server_in it(int argc, char **argv, char **groups);
                void STDCALL mysql_server_en d(void);

                Those functions seems to be *no implemented* in MySQLdb (I could not
                find them in _mysql.c file) :(

                If I understood the comment above, MySQLdb could be compiled with
                standard client library or with embed server library - not with both
                of them, right? :(

                --
                JZ

                Comment

                • Dennis Lee Bieber

                  #9
                  Re: libmysqld.dll - any working example?

                  JZ fed this fish to the penguins on Friday 28 November 2003 17:51 pm:

                  [color=blue]
                  > Do you know how to rebuild this module using Visual Studio 7 instead
                  > of v6? Is it possible?
                  >[/color]
                  Sorry, all I have is the training wheels edition of VC6 (IE, the
                  nagware executable type). I've always relied upon the pre-built files
                  when I can find them.


                  --[color=blue]
                  > =============== =============== =============== =============== == <
                  > wlfraed@ix.netc om.com | Wulfraed Dennis Lee Bieber KD6MOG <
                  > wulfraed@dm.net | Bestiaria Support Staff <
                  > =============== =============== =============== =============== == <
                  > Bestiaria Home Page: http://www.beastie.dm.net/ <
                  > Home Page: http://www.dm.net/~wulfraed/ <[/color]

                  Comment

                  • Dennis Lee Bieber

                    #10
                    Re: libmysqld.dll - any working example?

                    JZ fed this fish to the penguins on Saturday 29 November 2003 01:07 am:
                    [color=blue]
                    >
                    > If I understood the comment above, MySQLdb could be compiled with
                    > standard client library or with embed server library - not with both
                    > of them, right? :(
                    >[/color]

                    According to the book I have, the "final application" would have to be
                    linked to one or the other; the calls made are the same, those that
                    don't mean anything in one form are no-ops.

                    For Python usage, I hypothesize that one could possibly build a
                    version of MySQLdb (recommend modifying the name... maybe call it
                    MySQLdbe for embedded) linking to the second library. Changing the
                    import statement /should/ then be all that is needed to change
                    libraries. (I suspect it is much too late to make MySQLdb a package
                    with .client and .embedded subparts.)

                    Getting someone to actually /do/ the work of dual builds is another
                    matter. Hopefully the link is not tied to any particular library
                    version.

                    --[color=blue]
                    > =============== =============== =============== =============== == <
                    > wlfraed@ix.netc om.com | Wulfraed Dennis Lee Bieber KD6MOG <
                    > wulfraed@dm.net | Bestiaria Support Staff <
                    > =============== =============== =============== =============== == <
                    > Bestiaria Home Page: http://www.beastie.dm.net/ <
                    > Home Page: http://www.dm.net/~wulfraed/ <[/color]

                    Comment

                    • Dennis Lee Bieber

                      #11
                      Re: libmysqld.dll - any working example?

                      JZ fed this fish to the penguins on Friday 28 November 2003 19:15 pm:

                      [color=blue]
                      > I recompiled MySQLdb but I still do not know how to connect to embed
                      > server... :( MySQL.Connect(h ost=...)???? There is no example nor
                      > explanation. Not at all.
                      >[/color]
                      Looks like there may be a few extra steps needed... Stuffed into the
                      MySQLdb build system...

                      I'm hacking quickly through this book (note that the embedded option
                      is new with MySQL 4, probably why it hasn't appeared beforehand in this
                      group).

                      1 add mysql_embed.h to the set of MySQL header files used...

                      2 modify the client_groups array... (their example assumes a program
                      called embapp)
                      static const char *client_groups[] =
                      {
                      "client", "embapp", NULL
                      };
                      modify server_groups
                      static const char *server_groups[] =
                      {
                      "server", "embedded", "embapp_SERVER" , NULL
                      }; /* embapp is name of application */

                      3 call mysql_server_in it()
                      suggested to place just before the mysql_init() call

                      4 call mysql_server_en d()
                      just after the mysql_close() call


                      There is also a warning that your application should not be accessing
                      the same database directory as any other server on the machine.

                      The mysql_server_* calls are do-nothings if you link with the regular
                      client library, so once the above is done you can switch back by just
                      relinking.

                      --[color=blue]
                      > =============== =============== =============== =============== == <
                      > wlfraed@ix.netc om.com | Wulfraed Dennis Lee Bieber KD6MOG <
                      > wulfraed@dm.net | Bestiaria Support Staff <
                      > =============== =============== =============== =============== == <
                      > Bestiaria Home Page: http://www.beastie.dm.net/ <
                      > Home Page: http://www.dm.net/~wulfraed/ <[/color]

                      Comment

                      Working...