CakePHP: No such file or directory (trying to connect via unix:///var/mysql/mysql.sock)

后端 未结 3 958
甜味超标
甜味超标 2020-12-30 06:41

I have had a cakephp app running fine on my local machine (mac osx) for a while and then suddently I realise that I can\'t connect to mysql.sock.

I\'m getting this

3条回答
  •  情深已故
    2020-12-30 07:23

    In phpcake 2.0 use 'unix_socket' instead of port

     'Database/Mysql',
                'persistent' => false,
                'host' => 'localhost',
                'login' => 'dbUser',
                'password' => 'dbPassword',
                'database' => 'dbName',
                'prefix' => '',
                'unix_socket' => '/Applications/XAMPP/xamppfiles/var/mysql/mysql.sock', //Path for mac XAMPP
            );
        }
    

提交回复
热议问题