MySQL Configs Require 127.0.0.1 after CageFS setup
Forum
  1. Forums
  2. CloudLinux and Control Panels
  3. CloudLinux and cPanel
  1. OptimalGXP
  2. Wednesday, 21 September 2016
  3.  Subscribe via email
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.

I\'ve 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!
Rate this post:
  1. 01.11.2016 00:11:44
  2. # 1
OptimalGXP Accepted Answer
Posts: 2
Joined: 06.09.2016
0
Votes
Undo
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!
  1. 16.12.2019 08:12:45
  2. # 2
Code Ninja Accepted Answer
Posts: 0
Joined: 28.05.2020
0
Votes
Undo
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
  1. 16.12.2019 08:12:47
  2. # 3
Sergey Khristich Accepted Answer
Posts: 344
Joined: 20.05.2019
0
Votes
Undo
Hello! Happy to hear it and thanks for following up!
Marketing Manager
  • Page :
  • 1


There are no replies made for this post yet.
Be one of the first to reply to this post!
Guest
Submit Your Response
Upload files or images for this discussion by clicking on the upload button below. Supports gif,jpg,png,zip,rar,pdf
• Insert • Remove Upload Files (Maximum File Size: 2 MB)
Captcha
To protect the site from bots and unauthorized scripts, we require that you enter the captcha codes below before posting your question.