Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Access to mysql database in server

 
dushantha Rathnayake
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have tow applications.they are server side and client side. in server side i have mysql data base.now the problem is, I want to access into that database using client program.but I don't know how to do it. I tried with following connection statement.



Using this code application can't find the data base. so how can I do this? please help me.

Thank you.
 
Stephan Mueller
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
("jdbc:mysql://localhost/network_admin","root","")


If you are saying that your DBMS resides on a remote server, while you are executing the JDBC code on another client,
then you should understand that is the URL for this specific local client the code runs on.
You have to replace localhost with the host adress of the server.

If you are saying somethin else, I suggest that you rephrase your question, try to give more details like
an exact error message.
 
dushantha Rathnayake
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Actually this is my first remote product. I think you are correct. can you give me an example for this replacement? actually the exception is "Can not find the network_admin database" .

Thank you.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So this sounds like you may have a MySQL database running locally without the named database.

You need to replace localhost with the host name or IP address of the remote machine. What that is only you can tell us. You should maybe ask whoever set it up for you?
 
dushantha Rathnayake
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,



Actually my friend this is the only way that I know to connect the mysql database into java application. But I don't know this method is possible to remote applications. Think this, I have a mysql database.I can install it into server machine. and then I want to access into that particular database using client machine. So how can I do this? Please help me.

Thank you!
 
Stephan Mueller
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


and try to avoid using root with no password as the database user.
 
dushantha Rathnayake
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Thank you. Because now my product is work properly. In this case I got some problems then I disabled the windows firewall and then its properly work. Thank you very very much.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic