Sign in to follow this  
NFalcon

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

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
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
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
Have you tried starting from the beginning with various guides available at MySQL.com? Running a networked relational database is a little bit involved, and you'll probably do well to read the instructions and spend a few days actually learning it from the ground up.

Share this post


Link to post
Share on other sites
It would be something .conf mysql.conf maby? The last time I set up MySQL was on Linux...so I'm not sure where it would be in Windows. Most likely in the same directory as the rest of MySQL.

Share this post


Link to post
Share on other sites
MySQL's easy to configure, especially if you use the MySQL Admininstrator front end. In fact I'd say that tool is ESSENTIAL. It lets you check queries, examine all the tables and generally play with your database, including its service (so you can tweak the networking and so on). Port 3306 is the MySQL service port to leave open on any local firewall, although you can change that if you want.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this