Sreejith
unread,Oct 17, 2008, 7:56:28 AM10/17/08Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to iiitmk-webtec-group
Hi Friends,
We all saw how we could connect to a local database.
Its by using the mysql database url as
("jdbc:mysql:///database_name","user_name", "password");
OR
("jdbc:mysql://localhost/database_name","user_name", "password");
But inorder to connect to a remote database we have do a number of
steps.
* Edit the /etc/mysql/my.cnf file to change the bind address from
127.0.0.1 to the IP Address of the machine.
* Run the following sql command to grant privileges to user to use the
database from anywhere in the network.
GRANT ALL PRIVILEGES ON *.* TO user_name@"%" IDENTIFIED BY
'password';
or for a particular host it is
GRANT ALL PRIVILEGES ON *.* TO user_name@"Host_name" IDENTIFIED BY
'Password';
* The url to be used is
("jdbc:mysql://IP_ADDRESS/database_name","user_name","password");
Regards,
Sreejith