Library MYSQLCLIENT error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tmallardi
    Mini Mivite

    • Mar 2006
    • 30

    #1

    Library MYSQLCLIENT error

    I'm making my first attempt at writing Mivascript code to use MySQL data.

    I have installed latest MivaEmpress VM on my AlmaLinux server.

    I have upgraded to Miva compiler 5.50

    I tried to open a databse and received the error message below.

    MvOPEN: System library "MYSQLCLIENT" is not registered

    Is library part of the server operating system or internal to the MiveEMpress VM?

    Also, I've tried a thorough Internet search looking for any newer Mivascript command documentation.
    Where can recent documentation be found.

    Thank you,
    Tim
  • dcarver
    Director of Software Dev.




    • May 2013
    • 400

    #2
    You’ll need to set it as a SYSTEM library in your mivavm.conf file. If you look at the release notes that are packaged with the VM it will have documentation on it.
    David Carver
    Miva, Inc. | Software Developer

    Comment

    • wmgilligan
      Developer Partner




      • Feb 2006
      • 742

      #3
      In my case I had to find and install the client, then reference it in the conf file (in cgi-bin) like so:
      Code:
      <SYSTEM-LIB CODE="MYSQLCLIENT" LIBRARY="/usr/lib64/mysql57/libmysqlclient.so.1020">
      I can't help you in where to get it if your system does not have it. In our case it was an Amazon install, but not sure how I figured it out (lots of Googling).

      B
      William Gilligan - Orange Marmalade, Inc.
      www.OrangeMarmaladeinc.com

      Comment

      • tmallardi
        Mini Mivite

        • Mar 2006
        • 30

        #4
        Hey Bill,

        This worked on my server.

        <SYSTEM-LIB CODE="MYSQLCLIENT" LIBRARY="/usr/lib64/mysql/libmysqlclient.so.21">

        Well, it at least it got me past the error. Now I just have to figure out how to interact with the MySQL server.

        Thanks!!


        Comment

        • wmgilligan
          Developer Partner




          • Feb 2006
          • 742

          #5
          Awesome. Glad it helped. Here is some code to get you started..... Open a database, grab every row and cycle thru assigning the data to a variable. Then insert that info into another table (along with a timestamp), and then update another table with needed info... then clean up. In my case the "url" actually points to an Amazon RDS connection point. Local databases will be different. We store that info in the Miva data directory and grab it using an import.

          Code:
          <MvOPEN NAME = "active" DATABASE = "{ url }" TYPE = "mysql" USERNAME = "{ muser }" PASSWORD = "{ pass }">
          <MvOPENVIEW NAME = "active" VIEW="getBal" QUERY = "{ 'SELECT * FROM `balances` WHERE gobal > 0 ;' }">
          <MvWhile expr="{ NOT getBal.d.EOF }">
          <MvAssign name="l.fee" value="{ getBal.d.gobal }">
          <MvAssign name="l.omdesc" value="A note to share">
          <MvAssign name="l.acct" value="{ getBal.d.MYID }">
          <MvQUERY NAME = "active" QUERY = "{ 'INSERT INTO charges VALUES (NOW(),?,?,?);' }" FIELDS = "l.omdesc,l.fee,blank">
          <MvQUERY NAME = "active" QUERY = "{ 'UPDATE `gotab` SET  basis=\'XXXX\' WHERE ID=?' }" FIELDS = "l.acct">
          <MvSkip name="active" view="getBal">
          </MvWhile>
          <MvClose name="active">
          William Gilligan - Orange Marmalade, Inc.
          www.OrangeMarmaladeinc.com

          Comment

          • tmallardi
            Mini Mivite

            • Mar 2006
            • 30

            #6
            Bill,

            I'm now successfully interacting with the MySQL server using compiled Miva scripts.

            Thanks so much for the guidance.

            Tim

            Comment

            Working...
            X