phinx icon indicating copy to clipboard operation
phinx copied to clipboard

Can't connect DB /

Open yossi55 opened this issue 12 years ago • 2 comments

I installed phinx with composer but when I try to launch the first migration, Im getting this message:

Phinx by Rob Morgan - http://phinx.org. version 0.3.7

using config file ./phinx.yml
using config parser yaml
using migration path /Users/yossi/Documents/phpStormWorkspace/nh/migrations
warning no environment specified, defaulting to: yossi_dev_local
using adapter mysql
using database newhomes_dev



  [InvalidArgumentException]                                                               
  There was a problem connecting to the database: SQLSTATE[HY000] [2002] No such file or   
  directory                                                                                

Im using MAMP on Mac OS 10.9.4. I changed in the phinx.yml the connection to the db to :

 yossi_dev_local:
        adapter: mysql
        host: localhost
        name: newhomes_dev
        user: root
        pass: 'root'
        port: 8889
        charset: utf8

since I know that MAMP changes the default port. But I'm still getting the same problem every time I try to execute anything...

Not really sure what a sql error means by No such file or directory

Thanks for your help

yossi55 avatar Aug 29 '14 07:08 yossi55

@yossi55 This Stack Overflow answer might be helpful for your problem - http://stackoverflow.com/questions/22188026/sqlstatehy000-2002-no-such-file-or-directory/23433268#23433268

enkrates avatar Aug 29 '14 15:08 enkrates

Hi thanks, worked ;)

yossi55 avatar Aug 31 '14 13:08 yossi55