You provide the remote IP address and port # in the config. However, the remote db must be configured to allow for network connections. Check the remote DB config for the skip-networking and bind-address options.
Then also the DB user for the remote application must have permission to connect. Check the mysql.user table on the *remote* server. If the Host column for your User only includes a record for localhost then you'll need to GRANT again for the server IP:
GRANT SELECT,INSERT,UPDATE,DELETE ON db_remote.* TO 'user'@'xxx.xxx.xxx.xxx' IDENTIFIED BY 'thepassword';
FLUSH PRIVILEGES;
(Or db_remote.table_name if you don't require all of them to be accessed.)
On Wed, May 29, 2013 at 8:41 AM, Nikunj Amipara <nikamipara29@gmail.com> wrote:
hi all,Does any one have any idea how to connect to remote server in cakephp???i have one local database which does have most of required information for application to run but some data is needed from remote server.it means i want to connect cakephp to 2 databases at a time one local and one remote is it possible?can any one help ?thanks.--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
No comments:
Post a Comment