Jump to content
  • Advertisement
Sign in to follow this  
NFalcon

How do you change MYSQL's localhost to your IPAddress?

This topic is 4141 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have a program that can connect to my MySQL database that I have locally on my computer. What I would like to be able to do, is set it to where other computers around me can use this database as well. The parameter being passed in for the host is currently "localhost" and the only other thing I have been able to use other than that is "127.0.0.1". I have tried using my computer ipaddress as the parameter passed in, but it doesn't connect. Can anyone help me with this problem? This is using Visual Studios 2003, C++.

Share this post


Link to post
Share on other sites
Advertisement
I searched the message boards there and even posted, but have gotten no replies and couldn't find an answer to this solution.

Share this post


Link to post
Share on other sites
No I have not yet. I will give that a try. You don't need to use PHP in order to enable remote access do you, because I want to just run the database strictly from my PC for right now?

Share this post


Link to post
Share on other sites
What are the 'other pcs around you' connected to? Your LAN, or the internet? If what you think is 'your' IP address is actually your modem or router's IP address, then having others on a local network use it to connect will always fail.

Share this post


Link to post
Share on other sites
inside the mysql config, you need to comment out this line:

bind-address 127.0.0.1

Commenting out this line will let any ip address connect to it.

Share this post


Link to post
Share on other sites
I will try that too, I haven't gotten a chance to work on it in a couple of days do to work, but I will try the commenting out tonight.

The IP Address that I was using is the one I grab from run->ipconfig-IPAddress. I want to be able to leave the MYSQL database on my computer and allow others with this hardcoded address (for now) to be able to connect to that database.

Share this post


Link to post
Share on other sites
If you connect as localhost you don't use ip (127.0.0.1) and work by sockets, you are use named pipe.
You can force use sockets if are you connect to 127.0.0.1

I'm not sure, but it's like that.

Share this post


Link to post
Share on other sites
I can't seem to find my.cnf file anywhere. I have a my.ini but not the config file. What directory might it be located in. I have ran a search on my entire C: drive and found nothing.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!