Announcement

Collapse
No announcement yet.

MySQL Configs Require 127.0.0.1 after CageFS setup

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

  • MySQL Configs Require 127.0.0.1 after CageFS setup

    Hey there!

    Hope someone may have an answer for this.

    On one of our companies Cloud Linux installations for a Dedicated customer we noticed that after CageFS was setup all of the WordPress sites started to get database connection errors.

    The only problem was that they were set to connect to "localhost" rather than "127.0.0.1"

    After switching them to connect to 127.0.0.1 they started working again.

    Ive never experienced this on my own Cloud Linux server, and am wondering what may cause that?

    We found one post that suggested mod_php getting in the way somehow, but this is set to SuPHP.

    Thanks anyone who takes the time to answer!

  • #2
    As far as I know mysql connects over TCP/IP when using IP address (127.0.0.1), and use socket file when used localhost. In your situation I suppose you have mysql.sock in some special location and it is not available from CageFS inside. While /var/lib/mysql/ is being used by default.

    If so - please add that directory to /etc/cagefs/cagefs.mp file then run cagefsctl --remount-all .

    Comment


    • #3
      Hey there!

      Just wanted to update this post for anyone who may come across the same error. We came across another of our servers that ran into this problem after a CageFS installation, and finally found the problem.

      In our cases /etc/cagefs/cagefs.mp was actually just fine.

      The problem was actually with our /etc/my.cnf files.

      We had the socket directive labeled as "socket=/tmp/mysql.sock"

      But what we really needed it to be was "socket=/var/lib/mysql/mysql.sock"

      It took us a while to get that figured, but once we made the change and restarted MySQL all was well!

      Comment


      • #4
        > As far as I know mysql connects over TCP/IP when using IP address (127.0.0.1), and use socket file when used localhost. In your situation I suppose you have mysql.sock in some special location and it is not available from CageFS inside. While /var/lib/mysql/ is being used by default.[br][br]If so - please add that directory to /etc/cagefs/cagefs.mp file then run cagefsctl --remount-all .

        Yes It Work For Me

        Comment


        • #5
          Hello! Happy to hear it and thanks for following up!

          Comment

          Working...
          X