Il giorno 04/giu/09, alle ore 08:50, LBmtb ha scritto:

>
> Any idea why cake can get a database connection via the browser but
> not command line interface (trying to make a shell)?
>
> I'm dev'ing locally on a mac with XAMPP.
>
> Get this when trying to run the shell:
>
>
> 'Warning: mysql_connect(): Can't connect to local MySQL server through
> socket '/var/mysql/mysql.sock' (2) in /Applications/XAMPP/xamppfiles/
> cake/cake/libs/model/datasources/dbo/dbo_mysql.php on line 374
>
> Warning: mysql_select_db(): supplied argument is not a valid MySQL-
> Link resource in /Applications/XAMPP/xamppfiles/cake/cake/libs/model/
> datasources/dbo/dbo_mysql.php on line 379
>
> Warning: mysql_get_server_info(): supplied argument is not a valid
> MySQL-Link resource in /Applications/XAMPP/xamppfiles/cake/cake/libs/
> model/datasources/dbo/dbo_mysql.php on line 387
>
> Warning: mysql_query(): supplied argument is not a valid MySQL-Link
> resource in /Applications/XAMPP/xamppfiles/cake/cake/libs/model/
> datasources/dbo/dbo_mysql.php on line 411'


I don't know for XAMPP, but for MAMP I had to change the line
> $this->connection = mysql_connect($config['host'] . ':' .  
> $config['port'], $config['login'], $config['password'], true);

in the connect function of cake/libs/model/datasources/dbo/dbo_mysql.php
> $this->connection = mysql_connect(':/Applications/MAMP/tmp/mysql/ 
> mysql.sock', 'root', 'root', true);


Ciao
Paolo




--
Paolo Portaluri
mail: [email protected]
  web: http://work.to.it/
  AIM: poweruser82




--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to