Trying to set up CakePHP for the first time

JBeckton

Trying to set up CakePHP for the first time

Reply Threaded More More options
Print post
Permalink

I am in the process of learning PHP and wanted to get started with a
framework as well. I have several years dev experience with another
web language and I just feel naked when building apps without a
framework.

I was hoping that CakePHP would be easy to get running but that has
not been the case. I am on a Ubuntu 8 desktop with Apache2, MySQL and
PHP5 running.

I was following the instructions @ http://book.cakephp.org/view/27/developing-with-cakephp.

In MySQL I created a DB and a User account just for my app to use. I
put this information in the /app/config/database.php file thinking the
framework would use that information to connect to the DB.

Here is the message I am getting.


 Your tmp directory is writable.

The FileEngine is being used for caching. To change the config edit
APP/config/core.php

Your database configuration file is present.

Warning (2): mysql_connect() [function.mysql-connect]: Access denied
for user 'user'@'localhost' (using password: YES) [CORE/cake/libs/
model/datasources/dbo/dbo_mysql.php, line 117]

Warning (2): mysql_select_db(): supplied argument is not a valid MySQL-
Link resource [CORE/cake/libs/model/datasources/dbo/dbo_mysql.php,
line 122]

Warning (2): mysql_get_server_info(): supplied argument is not a valid
MySQL-Link resource [CORE/cake/libs/model/datasources/dbo/
dbo_mysql.php, line 130]

Cake is NOT able to connect to the database.

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

Daniel Hofstetter

Re: Trying to set up CakePHP for the first time

Reply Threaded More More options
Print post
Permalink

Hi,

[snipped]

> In MySQL I created a DB and a User account just for my app to use. I
> put this information in the /app/config/database.php file thinking the
> framework would use that information to connect to the DB.
>
> Here is the message I am getting.
>
>  Your tmp directory is writable.
>
> The FileEngine is being used for caching. To change the config edit
> APP/config/core.php
>
> Your database configuration file is present.
>
> Warning (2): mysql_connect() [function.mysql-connect]: Access denied
> for user 'user'@'localhost' (using password: YES) [CORE/cake/libs/
> model/datasources/dbo/dbo_mysql.php, line 117]
>
> Warning (2): mysql_select_db(): supplied argument is not a valid MySQL-
> Link resource [CORE/cake/libs/model/datasources/dbo/dbo_mysql.php,
> line 122]
>
> Warning (2): mysql_get_server_info(): supplied argument is not a valid
> MySQL-Link resource [CORE/cake/libs/model/datasources/dbo/
> dbo_mysql.php, line 130]
>
> Cake is NOT able to connect to the database.

You either have a typo in database.php or the user you created doesn't
have the privilege to access the respective database.

Hope that helps!

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

JBeckton

Re: Trying to set up CakePHP for the first time

Reply Threaded More More options
Print post
Permalink
In reply to this post by JBeckton
Thanks for the help but I figured this one out shortly after my post.
 
The problem is that MySQL out of the box does not allow any users to connect to it via localhost other than root. So I just used the root login for now seeings how I am developing on my local machine. I created a DB user specifically for that DB and used it in the CakePHP DB config but I believe MySQL will not allow that user to connect via local host unless configured to do so.

Regards
 
On 8/31/08, JBeckton <[hidden email]> wrote:

I am in the process of learning PHP and wanted to get started with a
framework as well. I have several years dev experience with another
web language and I just feel naked when building apps without a
framework.

I was hoping that CakePHP would be easy to get running but that has
not been the case. I am on a Ubuntu 8 desktop with Apache2, MySQL and
PHP5 running.

I was following the instructions @ http://book.cakephp.org/view/27/developing-with-cakephp.

In MySQL I created a DB and a User account just for my app to use. I
put this information in the /app/config/database.php file thinking the
framework would use that information to connect to the DB.

Here is the message I am getting.


Your tmp directory is writable.

The FileEngine is being used for caching. To change the config edit
APP/config/core.php

Your database configuration file is present.

Warning (2): mysql_connect() [function.mysql-connect]: Access denied
for user 'user'@'localhost' (using password: YES) [CORE/cake/libs/
model/datasources/dbo/dbo_mysql.php, line 117]

Warning (2): mysql_select_db(): supplied argument is not a valid MySQL-
Link resource [CORE/cake/libs/model/datasources/dbo/dbo_mysql.php,
line 122]

Warning (2): mysql_get_server_info(): supplied argument is not a valid
MySQL-Link resource [CORE/cake/libs/model/datasources/dbo/
dbo_mysql.php, line 130]

Cake is NOT able to connect to the database.


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

MikeArsenault

Re: Trying to set up CakePHP for the first time

Reply Threaded More More options
Print post
Permalink
I am setting CakePHP up in a managed hosting environment where they use CPanel, and the EXACT same thing happened. For some reason, the way CakePHP wants to connect to the DB prevents me from having a local db user and password that's appicable to the database I am wanting to use to power Cake if I use 'localhost'... I instead had to use the default DB credentials (which in this host are set up to be my ISP username and password) in order to have Cake connect using 'localhost'. The way my ISP has stuff set up, you can't get at the actual IP address of the DB server nor can you assign new db users to be able to use localhost as an accepted host.

Which is retarded, as if I write a normal PHP script and just use the basic mysql functions inherent in PHP to connect using the special user I created to use with Cake, it lets me through no problem using 'localhost' and I get a proper resource identifier as a result of the mysql_connect() function. Not sure whether to be saluting the ISP or Cake for being weird :/


JBeckton wrote:
Thanks for the help but I figured this one out shortly after my post.

The problem is that MySQL out of the box does not allow any users to connect
to it via localhost other than root. So I just used the root login for now
seeings how I am developing on my local machine. I created a DB user
specifically for that DB and used it in the CakePHP DB config but I believe
MySQL will not allow that user to connect via local host unless configured
to do so.

Regards

On 8/31/08, JBeckton <jbeckton@gmail.com> wrote:
>
>
> I am in the process of learning PHP and wanted to get started with a
> framework as well. I have several years dev experience with another
> web language and I just feel naked when building apps without a
> framework.
>
> I was hoping that CakePHP would be easy to get running but that has
> not been the case. I am on a Ubuntu 8 desktop with Apache2, MySQL and
> PHP5 running.
>
> I was following the instructions @
> http://book.cakephp.org/view/27/developing-with-cakephp.
>
> In MySQL I created a DB and a User account just for my app to use. I
> put this information in the /app/config/database.php file thinking the
> framework would use that information to connect to the DB.
>
> Here is the message I am getting.
>
>
> Your tmp directory is writable.
>
> The FileEngine is being used for caching. To change the config edit
> APP/config/core.php
>
> Your database configuration file is present.
>
> Warning (2): mysql_connect() [function.mysql-connect]: Access denied
> for user 'user'@'localhost' (using password: YES) [CORE/cake/libs/
> model/datasources/dbo/dbo_mysql.php, line 117]
>
> Warning (2): mysql_select_db(): supplied argument is not a valid MySQL-
> Link resource [CORE/cake/libs/model/datasources/dbo/dbo_mysql.php,
> line 122]
>
> Warning (2): mysql_get_server_info(): supplied argument is not a valid
> MySQL-Link resource [CORE/cake/libs/model/datasources/dbo/
> dbo_mysql.php, line 130]
>
> Cake is NOT able to connect to the database.
>
> >
>

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

Re: Trying to set up CakePHP for the first time

Reply Threaded More More options
Print post
Permalink
Hmmm, ok I actually got it to work as it seems the ISP was having problems with me making non-persistent connections to the DB using the non-root usr/psw and host of 'localhost'. When I set the 'persistent' configuration option in database.php from false to true, it worked just fine! WEIRD!

MikeArsenault wrote:
I am setting CakePHP up in a managed hosting environment where they use CPanel, and the EXACT same thing happened. For some reason, the way CakePHP wants to connect to the DB prevents me from having a local db user and password that's appicable to the database I am wanting to use to power Cake if I use 'localhost'... I instead had to use the default DB credentials (which in this host are set up to be my ISP username and password) in order to have Cake connect using 'localhost'. The way my ISP has stuff set up, you can't get at the actual IP address of the DB server nor can you assign new db users to be able to use localhost as an accepted host.

Which is retarded, as if I write a normal PHP script and just use the basic mysql functions inherent in PHP to connect using the special user I created to use with Cake, it lets me through no problem using 'localhost' and I get a proper resource identifier as a result of the mysql_connect() function. Not sure whether to be saluting the ISP or Cake for being weird :/


JBeckton wrote:
Thanks for the help but I figured this one out shortly after my post.

The problem is that MySQL out of the box does not allow any users to connect
to it via localhost other than root. So I just used the root login for now
seeings how I am developing on my local machine. I created a DB user
specifically for that DB and used it in the CakePHP DB config but I believe
MySQL will not allow that user to connect via local host unless configured
to do so.

Regards

On 8/31/08, JBeckton <jbeckton@gmail.com> wrote:
>
>
> I am in the process of learning PHP and wanted to get started with a
> framework as well. I have several years dev experience with another
> web language and I just feel naked when building apps without a
> framework.
>
> I was hoping that CakePHP would be easy to get running but that has
> not been the case. I am on a Ubuntu 8 desktop with Apache2, MySQL and
> PHP5 running.
>
> I was following the instructions @
> http://book.cakephp.org/view/27/developing-with-cakephp.
>
> In MySQL I created a DB and a User account just for my app to use. I
> put this information in the /app/config/database.php file thinking the
> framework would use that information to connect to the DB.
>
> Here is the message I am getting.
>
>
> Your tmp directory is writable.
>
> The FileEngine is being used for caching. To change the config edit
> APP/config/core.php
>
> Your database configuration file is present.
>
> Warning (2): mysql_connect() [function.mysql-connect]: Access denied
> for user 'user'@'localhost' (using password: YES) [CORE/cake/libs/
> model/datasources/dbo/dbo_mysql.php, line 117]
>
> Warning (2): mysql_select_db(): supplied argument is not a valid MySQL-
> Link resource [CORE/cake/libs/model/datasources/dbo/dbo_mysql.php,
> line 122]
>
> Warning (2): mysql_get_server_info(): supplied argument is not a valid
> MySQL-Link resource [CORE/cake/libs/model/datasources/dbo/
> dbo_mysql.php, line 130]
>
> Cake is NOT able to connect to the database.
>
> >
>

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