Skip to content
This repository has been archived by the owner on Jan 3, 2023. It is now read-only.

Can't connect to local MySQL server through socket #150

Open
kevin7b opened this issue Aug 29, 2019 · 1 comment
Open

Can't connect to local MySQL server through socket #150

kevin7b opened this issue Aug 29, 2019 · 1 comment

Comments

@kevin7b
Copy link

kevin7b commented Aug 29, 2019

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13)

I try to run it manually with a hardcoded values, it work.
But when I try to connect using OpenVPN GUI in windows, the login.sh cant connect and give that error.

I use CentOS 7 64bit

  • **PHP version: 5.6
  • MySQL version: 5.5.60-MariaDB
  • **Webserver (Nginx, Apache...): Apache
  • What is the expected behaviour? account to connect
  • What do you see instead? I get bad account, i guess its because it cant connect to mysql
  • PHP logs on pastebin: https://pastebin.com/ZNAE116w
@QingfengLee
Copy link
Contributor

I have encountered the same problem. It is caused by a problem with SELinux. The login script runs with the user 'nobody', and cannot access the file '/var/lib/mysql/mysql.sock'.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants