Click here to Skip to main content
15,867,308 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,
I am using MySQL as my application database in a local network applications. And in connection string I used IP address instead of computer-name. And the last three years everything worked very well without any errors but recently we changed our sever as a DHCP sever. From that point I am getting many connection errors as MySQL host not responding, connection failed etc. I just want to know can I have any benefits if I use computer name/server name in application connections string instead of IP Address?. As I am a newbie please help me to distinguish between using IP address and computer name in connection strings.

What I have tried:

I tried debugging the connection errors. And it seems that same IP address is sometimes used by two computers causing the issues. I am not able to make any change in applications unless until i have an expert advice regarding.
-Thanks in advance
Posted
Updated 18-Jul-16 21:32pm

1 solution

Quote:
same IP address is sometimes used by two computers
That means that you did not set up your network properly. Likely, there are still some computers still using fixed IP addresses instead of IP addresses from the DHCP server. So your problems are not a MySQL problem but a network configuration problem.
Normally a DHCP server can be told which addresses it can assign automatically, and which addresses are reserved. Look thru all computers and other devices (e.g. printers) in your network, make sure they get their addresses from the DHCP server, or their fixed IP address falls into the reserved range (and is unique).
 
Share this answer
 
Comments
Manu Prasad 19-Jul-16 5:07am    
Hello, Is this affects MySQL connection?. I just want to finalise that the problem is there in the network not connection string inside application.
Bernhard Hiller 20-Jul-16 2:54am    
It can affect it, but it that is not necessary. When the computer trying to connect to the database does not "see" the correct machine, the connection will fail of course.
Manu Prasad 21-Jul-16 4:00am    
Hi, Thank you. But please note that I have the MySQL server in main server which has a reserved IP. And I am trying to access that server from client computers connected to main server and all are having dynamic IP.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900