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

Started by
11 comments, last by _winterdyne_ 16 years, 9 months ago
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++.
Advertisement
This might not help, but the ip address of localhost is always 127.0.0.1, so those are the same. Have you tried searching the mysql website?
"I thought what I'd do was, I'd pretend I was one of those deaf-mutes." - the Laughing Man
I searched the message boards there and even posted, but have gotten no replies and couldn't find an answer to this solution.
Did you enable remote access?
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?
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.
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.
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.
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.
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.

This topic is closed to new replies.

Advertisement