Announcement

Collapse
No announcement yet.

Plesk / Miva / MySQL misery...

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

    Plesk / Miva / MySQL misery...

    Hi everybody,

    Has anybody a clue why I get the following darn error when trying to connect to a MySQL db through Mivascript - and what to do about it?

    "OPEN ERROR: Unable to connect to database: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) "

    The mysql.so lib is recognized and vhost.conf updated. DB-user permissions seem to be okay.

    The Mivascript is not the problem, it's a single line to connect to the db.

    Plesk 8.1.1, Suse Linux, MySQL 4.1

    Thanks for any hints,

    Markus
    Emerald Media, Trade & Technology USA/Germany
    Professional Miva Programming since 1998
    Home of the Emerald Objects Application Server (EOA)
    Multi-dimensional CRM, CMS & E-Commerce

    http://www.emeraldobjects.com
    http://www.sylter-seiten.com

    #2
    Re: Plesk / Miva / MySQL misery...

    That's probably because mySQL has the socket file in /var/lib/mysql/mysql.sock, not in the /tmp directory. Check your my.cnf file to make sure the socket path is properly defined under mysqld, and possibly under client as well.

    Then, restart mysqld and see if your script connects to the database.

    Comment


      #3
      Re: Plesk / Miva / MySQL misery...

      Originally posted by dotCOM_host
      That's probably because mySQL has the socket file in /var/lib/mysql/mysql.sock, not in the /tmp directory. Check your my.cnf file to make sure the socket path is properly defined under mysqld, and possibly under client as well.

      Then, restart mysqld and see if your script connects to the database.

      Hi Remik,

      Thanks a lot for your answer. This definitely seems to be the problem, however my Plesk server doesn't accept those changes. When I set the sockets to the /tmp directory and restart MySQL, Miva effectively connects fine, but then Plesk or the mail server (and probably a few other services, too) won't work anymore - which creates a hell of a mess.

      I wonder if there are any particular "time-wasting"-settings hidden in Plesk...

      Grrrr...

      Do you think there could be a way to have more than one my.conf and separate the Plesk MySQL database from my content databases and configure them independently?

      Thanks again,

      Markus
      Emerald Media, Trade & Technology USA/Germany
      Professional Miva Programming since 1998
      Home of the Emerald Objects Application Server (EOA)
      Multi-dimensional CRM, CMS & E-Commerce

      http://www.emeraldobjects.com
      http://www.sylter-seiten.com

      Comment


        #4
        Re: Plesk / Miva / MySQL misery...

        Bingo!

        To solve this problem, it is necessary to link from /tmp/mysql.sock like this:

        ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock

        Markus

        (Sometimes I REALLY miss my old typewriter. )
        Emerald Media, Trade & Technology USA/Germany
        Professional Miva Programming since 1998
        Home of the Emerald Objects Application Server (EOA)
        Multi-dimensional CRM, CMS & E-Commerce

        http://www.emeraldobjects.com
        http://www.sylter-seiten.com

        Comment


          #5
          Re: Plesk / Miva / MySQL misery...

          Hi Markus

          I had this error constantly using Plesk as well and used your solution above however my tmp directory was being cleared every 10 days so the error resurfaced and I had to do the symlink again. Stumbled across that if I used 127.0.0.1 instead of localhost in the database variable it worked fine and has ever since.

          Cheers, Allan

          Comment


            #6
            Re: Plesk / Miva / MySQL misery...

            Hi Allan,

            Thanks for your reply - that is definitely good to know. I certainly don't want to look into it over and over again; so I'll give it a try with 127.0.0.1.

            Markus
            Emerald Media, Trade & Technology USA/Germany
            Professional Miva Programming since 1998
            Home of the Emerald Objects Application Server (EOA)
            Multi-dimensional CRM, CMS & E-Commerce

            http://www.emeraldobjects.com
            http://www.sylter-seiten.com

            Comment


              #7
              Re: Plesk / Miva / MySQL misery...

              Hmmm, that's an interesting one. Haven't seen it before - and we have a few hundred Linux servers with Plesk so if there was an issue I'm sure we would have noticed by now. What we have noticed, though, is that some apps prefer "localhost.localdomain" (or 127.0.0.1 as Allan suggested) rather than "localhost".

              Alan - are you also running Plesk on Suse Linux? That is one thing we do not run here - I wonder if this issue is simply isolated to that particular distro and doesn't affect the other popular releases.

              Comment


                #8
                Re: Plesk / Miva / MySQL misery...

                I'm actually running on Fedora. Apart from the symlink and changing to 127.0.0.1 I couldn't find anything else that worked.

                Comment


                  #9
                  Re: Plesk / Miva / MySQL misery...

                  Files that haven't been updated/requested recently will get cleaned out of /tmp. If you're working on a dev store and you let it sit, you'll lose the symlink. You can set up a CRON task to request a page on the dev site if you don't want to worry about it. Active stores that are accessed daily shouldn't have the issue.

                  Jen
                  Hostasaurus.Com
                  Miva Merchant Premier Hosting Partner
                  877.DINO.POWER
                  813.217.4570
                  [email protected]

                  Comment


                    #10
                    Re: Plesk / Miva / MySQL misery...

                    I use a dedicated server from Hostasaurus (love it by the way) and like they mention on little used site you will lose the symbolic link on a regular basis in a Plesk based Miva Merchant and mysql server, (hating that by the way) however the change in the merchdb.dat from from localhost to 127.0.0.1 has work fine for me and doesn't break anything else. Nor do I have to remember to ssh in and ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock anytime I want to try out a new test module or what not... Goodtimes...

                    Comment

                    Working...
                    X