How to make mySQL database at my local accessible from different machines?

sushil bharwani picture sushil bharwani · Dec 4, 2012 · Viewed 14.8k times · Source

I have mySQL installed at my Windows system which I connect using mySQL Query Browser. I am giving training and I want people to be able to connect to my machines SQL Database

How do I do that? Currently its not allowing the connections.

What settings do I need to modify?

Answer

Oscar Foley picture Oscar Foley · Dec 4, 2012

STEP 1: Check IP connectivity

By default it only allows connections from 127.0.0.1. Are you using windows or linux?

Open my.cnf and change bind address to your network IP.

[mysqld]
user            = mysql
pid-file        = /var/run/mysqld/mysqld.pid
socket          = /var/run/mysqld/mysqld.sock
port            = 3306
basedir         = /usr
datadir         = /var/lib/mysql
tmpdir          = /tmp
language        = /usr/share/mysql/English
bind-address    = 127.0.0.1

More info can easily be found in google. Check this.

STEP 2: Check your firewall

Also, as commented by @Leandro, check your windows firewall settings to allow connections to happen.

One easy way to test it is to make a telnet from the client machine to your MySQL network ip, port 3306 and see if connects or get blocked.

STEP 3: Check mysql user permissions

Once you have IP connectivity, the user that your alumni are using should have log in permissions from any host. For example if they use root you have to run a query like this:

update user set host=’%’ where user=’root’ and host=’ubuntuserv’;

You can see more info here.