Yii Framework Forum: Osx/mamp Mysql Problem - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Osx/mamp Mysql Problem Rate Topic: -----

#1 User is offline   AndyWallace 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 31-January 13

Posted 31 January 2013 - 07:25 PM

I am trying to set up yii with MAMP on my macbook pro, but am running into errors when trying to run the "yiic migrate" command:


Yii Migration Tool v1.0 (based on Yii v1.1.13)

PHP Error[2]: PDO::__construct(): [2002] No such file or directory (trying to connect via unix:///var/mysql/mysql.sock)
in file /Applications/MAMP/framework/db/CDbConnection.php at line 423
#0 /Applications/MAMP/framework/db/CDbConnection.php(423): PDO->__construct()
#1 /Applications/MAMP/framework/db/CDbConnection.php(373): CDbConnection->createPdoInstance()
#2 /Applications/MAMP/framework/db/CDbConnection.php(330): CDbConnection->open()
#3 /Applications/MAMP/framework/db/CDbConnection.php(308): CDbConnection->setActive()
#4 /Applications/MAMP/framework/base/CModule.php(387): CDbConnection->init()


The phpMyAdmin that came with MAMP is running correctly, and I can connect to the database from the command line (it's in /Applications/MAMP/Library/bin/mysql). My connection info (this is from config/console.php, and main is the same):

'db'=>array(
'connectionString' => 'mysql:port=8889;dbname=co_dev',
'emulatePrepare' => true,
'username' => <my database user is here>,
'password' => <my password is here>,
'charset' => 'utf8',
),

Any thoughts?

Thanks,
Andy
0

#2 User is offline   yugene 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 513
  • Joined: 08-August 09

Posted 02 February 2013 - 05:24 AM

Is you front-end work correctly or you get the same error?


First of all I'd check your DSN string, trying to set host to '127.0.0.1' or 'localhost'

Also there're several solutions to this error you may find with a bit of googling,for example:
http://www.webbykat....le-or-directory


0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users