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 7723185
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T04:22:48+00:00 2026-06-01T04:22:48+00:00

My web page returns an error for the calls to mysql_connect() for this Mac

  • 0

My web page returns an error for the calls to mysql_connect() for this Mac OSX 10.6.6, MAMP setup.

Warning: mysql_connect(): [2002] No such file or directory (trying to connect via unix:///var/mysql/mysql.sock) in /Library/WebServer/Documents/index.php on line 51 

Warning: mysql_connect(): No such file or directory in /Library/WebServer/Documents/index.php on line 51 Could not connect to database, check database credentials in config.php`

When I echo the host, username, password for mysql_connect() they are the same as the MAMP preferences 'localhost:8889', 'root', 'password'

Why can’t mysql_connect access the database?

  • 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-06-01T04:22:49+00:00Added an answer on June 1, 2026 at 4:22 am

    Find the current php.ini file (run a script containing: and search for the location) and change the sock to the mamp-sock:

    mysql.default_socket = /Applications/MAMP/tmp/mysql/mysql.sock
    

    If there are more occurrences of var/mysql/mysql.sock, change them as well.

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

Sidebar

Related Questions

I have a web page that returns this JSON when called: [{id:53,desc:Roberts}] I am
I'm working on a web page where I'm making an AJAX call that returns
My web service method returns a Page object which includes the following methods: public
web page : http://sideradesign.com/eco-art/gallery/ This code works fine in all brwosers except IE8 (haven't
My web page sits in a DIV that is 960px wide, I center this
This web page http://www.w3schools.com/ASP/prop_sessionid.asp states that a session ID is generated on the ServerSide.
I have an ASP.NET page that needs to make calls to multiple web services
I have a web page that will make frequent calls to a data source.
making a call to a web service method with nusoap returns an error array(3)
Okay this is a real headscratcher. I have an application which calls a web

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.