Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 526019
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T08:43:57+00:00 2026-05-13T08:43:57+00:00

This is driving me nuts! I am getting the classic Can’t connect to local

  • 0

This is driving me nuts! I am getting the classic “Can’t connect to local MySQL server through socket ‘/var/run/mysql4d/mysql4d.sock’ (13)”.

Everything I’ve dug up so far tells me my setup should be OK (eg, defining the sockets in php.ini and my.cnf, etc). Worse… phpmyadmin works with the same un/pw I am using in my own php. So obviously it’s possible to connect, but I am screwing it up

I tried reverse-engineering the connection from phpmyadmin, but gave up it as too convoluted after a couple hours.

Can anyone offer some advice?

My configuration: Ubuntu 9.10 (Karmic), Apache 2.2, PHP 5.2.6, MySQL 4.1.22 (for legacy app reasons).

my.cnf (/var/lib/mysql4/my.cnf):

[client]
port = 3306
socket = /var/run/mysql4d/mysql4d.sock
[mysqld]
port = 3306
socket = /var/run/mysql4d/mysql4d.sock

php.ini (/etc/php5/apache2/php.ini):

[MySQL]
mysql.default_socket = /var/run/mysql4d/mysql4d.sock
[MySQLi]
mysql.default_socket = /var/run/mysql4d/mysql4d.sock

Same problem using mysql instead of mysqli, btw.

EDIT:
I should mention that I have installed mysql4 alongside the ubuntu default install of php & mysql for use with a legacy application and it is this installation that I am having trouble connecting with. I tried this:

ini_set(‘mysql.default_socket’, ‘/var/run/mysql4d/mysql4d.sock’);

and now the connection goes thru, but all queries return empty sets. (cries in frustration)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T08:43:57+00:00Added an answer on May 13, 2026 at 8:43 am

    This sounds like a permission problem in /var/run/mysql4d/mysql4d.sock. What user are you running this as? Are the permissions o.k. on file system level?

    If you Google for the error messages, you’ll find a lot of people who had this and it was always a permission issue, sometimes due to an activated SELinux. Check this thread for a few possible solutions.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is driving me nuts! I'm getting some JSON from my server: {id262:{done:null,status:null,verfall:null,id:262,bid:20044,art:owner,uid:demo02,aktion:null,termin_datum:null,docid:null,gruppenid:null,news:newsstring,datum:11.06.2010,header:headerstring,for_uid:demo01}, id263:{done:null,status:pending,verfall:null,bid:20044,id:263,uid:demo02,art:foo,aktion:dosomething,termin_datum:11.06.2010,docid:null,gruppenid:null,datum:11.06.2010,news:newsstring,for_uid:demo01,header:headerstring},
This is driving me nuts. I can't work it out stepping through with Firebug
This has been driving me nuts. I keep getting the following exception System.InvalidOperationException: The
This is driving me nuts. I can't seem to get the data template within
This is driving me nuts, I can't see the problem. Using jQuery (I'm stuck
This error has been driving me nuts. We have a server running Apache and
This is driving me nuts and I can't figure out where I am dropping
Calling this powershell command and getting an error. Driving me nuts. Prompt> get-childitem -recurse
This error message is driving me nuts. I'm getting it when using Html.ListBox and
This is driving me nuts. Can anyone post a practical example on this? My

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.