MySQL DB Error: SQLSTATE[HY000] [2002] Permission denied (GET /)

Since I ran the latest patches updates on Tumbleweed any php application in my websites that tries to connect to a MySQL database on the same host (localhost) gives a permission error:

DB Error: SQLSTATE[HY000] [2002] Permission denied (GET /)

This appears only in the system log, the database log records nothing.

From the CLI interface I can access databases with the same user ids I have on the php application successfully and read tables and run selects no problem.

I am not sure this is necessarily a MySQL issue because the database log is recording nothing and I am not running either apparmor of firewall on this particular server.

Any ideas on what can cause this?

From your description,
It sounds to me that the problem is in your PHP, not MySQL.

And, that would be entirely dependent on how your PHP website is written.
So, I don’t know that anyone can really help you, you’ll have to talk to your website coders/authors if possible, or dig into that part of your website yourself.

Or, if your situation is critical and/or beyond your expertise you may want to just roll back (BTRFS?)


The two websites in questions are standard open source packages Roundcube Mail and Word Press. I am not a php developer (I never went past C or shell script programming),
and I tend to agree with your assessment it may be dependent on the php, or maybe the apache mod_php module because connecting locally from the MySQL CLI works just fine.

Rolling back may be a problem because that was the first time I updated tumbleweed, so rolling back 1700+ patches would be equivalent to starting from the DVD distribution. However, I am considering the following two other options:

  1. Falling back to a Leap distribution, which I have on a second machine and it works just fine with Word Press.
  2. Try mariadb or postgreSQL.

Any advice?

Hi, I have exactly the same problem after last update. My local users can not connect to MySQL with “permission denied”.

My solution was chmod g+rwx /var/run/mysql & chmod o+rx /var/run/mysql. It works now.

Have you tried from the command line client? It works for me, only from php apps through apache2 it fails.

Fantastic! It worked for me as well, thank you so much!!:shake: