Hi,
Following the book’s instructions in Chapter 8, I was able to open the Yii interactive tool and see Rbac in the list of available commands, but when I ran it, i got this error message, which I don’t understand and don’t know how to fix and I didn’t see this topic anywhere on the forum. I’m using MAMP on a Mac (this is my mysql path
/Applications/MAMP/Library/bin/mysql
) . Something about database problem but I haven’t had any trouble connecting to mysql up to this point.
Anyone have an idea?
USAGE
rbac
DESCRIPTION
This command generates an initial RBAC authorization hierarchy.
>> rbac
Warning: PDO::__construct(): [2002] No such file or directory (trying to connect via unix:///var/mysql/mysql.sock) in /Applications/MAMP/htdocs/framework/db/CDbConnection.php on line 389
exception 'CDbException' with message 'CDbConnection failed to open the DB connection: SQLSTATE[HY000] [2002] No such file or directory' in /Applications/MAMP/htdocs/framework/db/CDbConnection.php:348
Stack trace:
#0 /Applications/MAMP/htdocs/framework/db/CDbConnection.php(297): CDbConnection->open()
#1 /Applications/MAMP/htdocs/framework/db/CDbConnection.php(275): CDbConnection->setActive(true)
#2 /Applications/MAMP/htdocs/framework/base/CModule.php(372): CDbConnection->init()
#3 /Applications/MAMP/htdocs/framework/web/auth/CDbAuthManager.php(540): CModule->getComponent('db')
#4 /Applications/MAMP/htdocs/framework/web/auth/CDbAuthManager.php(58): CDbAuthManager->getDbConnection()
#5 /Applications/MAMP/htdocs/framework/base/CModule.php(372): CDbAuthManager->init()
#6 /Applications/MAMP/htdocs/framework/base/CModule.php(86): CModule->getComponent('authManager')
#7 /Applications/MAMP/htdocs/demo/protected/commands/shell/RbacCommand.php(27): CModule->__get('authManager')
#8 /Applications/MAMP/htdocs/framework/cli/commands/ShellCommand.php(147): RbacCommand->run(Array)
#9 /Applications/MAMP/htdocs/framework/cli/commands/ShellCommand.php(99): ShellCommand->runShell()
#10 /Applications/MAMP/htdocs/framework/console/CConsoleCommandRunner.php(63): ShellCommand->run(Array)
#11 /Applications/MAMP/htdocs/framework/console/CConsoleApplication.php(88): CConsoleCommandRunner->run(Array)
#12 /Applications/MAMP/htdocs/framework/base/CApplication.php(155): CConsoleApplication->processRequest()
#13 /Applications/MAMP/htdocs/framework/yiic.php(33): CApplication->run()
#14 /Applications/MAMP/htdocs/demo/protected/yiic.php(7): require_once('/Applications/M...')
#15 /Applications/MAMP/htdocs/demo/protected/yiic(4): require_once('/Applications/M...')
#16 {main}