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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T20:17:28+00:00 2026-05-30T20:17:28+00:00

This is my first time installing a framework, and I am pretty clueless. I

  • 0

This is my first time installing a framework, and I am pretty clueless.

I am on OSX 10.7 and I have the cakephp framework loaded into /Library/WebServer/Documents/cakephp and I have been able to load the test page and get rid of some of the errors and warnings. Right now I am trying to resolve this

  Warning (2): PDO::__construct() [pdo.--construct]: [2002] No such file or directory (trying to connect via unix:///var/mysql/mysql.sock) [CORE/Cake/Model/Datasource/Database/Mysql.php, line 160]
  Cake is NOT able to connect to the database.
  Database connection "SQLSTATE[HY000] [2002] No such file or directory" is missing, or could not be created.

I don’t really know what to do here. I have installed MySQL. Does the MySQL PDO come installed on OSX by default? or do I need to install that? How can I check if that is installed if that seems to be the problem.

UPDATE:

The PDO Mysql driver is enabled.
Also the phpinfo() for pro_mysql looks like this:

 Directive                     Local Value               Master Value
 pdo_mysql.default_socket   /var/mysql/mysql.sock   /var/mysql/mysql.sock 

However the mysql directory doesn’t appear in my filesystem. should I create it? or do I nee to change this path somewhere?

UPDATE:
I think the problem is that I haven’t actually set up a database. kindof dumb of me not to set up the database.

I guess I will try to figure that out now.

UPDATE:

The thing that finally solved this was that cake was looking for the Unix socket to the database in /var/mysql/mysql.sock but mysql was using the socket in /tmp/mysql.sock
I fixed this by creating a symbolic link from the /var/mysql/mysql.sock to /tmp/mysql.sock.

  • 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-30T20:17:30+00:00Added an answer on May 30, 2026 at 8:17 pm

    It looks more like MySQL itself is not installed, but the PDO libraries are compiled with your webserver. I am not sure how to check this in OSX, but you can try checkign this link out: http://www.sequelpro.com/docs/Install_MySQL_on_Mac_OS_X

    EDIT

    Log into MySQL (mysql -u root -p) and create the databas:

    create database cakephp
    

    Then create a new username/password and grant them access to this database. Let’s say you want to create the username cakephp and the password cakepass:

    GRANT ALL ON cakephp.* TO cakephp@localhost IDENTIFIED BY 'cakepass';
    FLUSH PRIVILEGES;
    

    And now your database.php config file should look like this:

    <?php
    class DATABASE_CONFIG {
        public $default = array(
            'datasource'  => 'Database/Mysql',
            'persistent'  => false,
            'host'        => 'localhost',
            'login'       => 'cakephp',
            'password'    => 'cakepass',
            'database'    => 'cakephp',
            'prefix'      => ''
        );
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is my first time with Web services. I have to develop web services
this is my first time posting here, I have a question which I have
this is my first time using StAX for parsing XML documents (still in the
I am trying to install elastic plugin. This is first time i am installing
I am installing CakePHP for the first time, I am running LAMP on Ubuntu
First time bitnami user here. I'm having some problems after installing this bitnami ami
This is my first time attempting to call an ASP.NET page method from jQuery.
This is my first time using joomla. I don't know if I'm using the
This is my first time on StackOverflow though I read Coding Horror quite often.
This is the first time I'm creating an open-source project, and I've decided (based

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.