1

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?

Sathyajith Bhat
  • 21,321
  • 22
  • 95
  • 134
sushil bharwani
  • 29,685
  • 30
  • 94
  • 128

2 Answers2

2

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.

Oscar Foley
  • 6,817
  • 8
  • 57
  • 90
  • 1
    Be sure to check your firewall also. It could block the necessary port. – Leandro Barreto Dec 04 '12 at 11:04
  • Changing the bind address to the network IP will *block* connections on the loopback address. Setting it 0.0.0.0 means it will accept connections from any address (which is a really bad idea unless you've got a firewall to restrict the hosts/networks which can connect). – symcbean Dec 04 '12 at 11:09
  • I dont have bind-address parameter. And i am using windows machine. What is host - 'ubunutuserv' – sushil bharwani Dec 04 '12 at 11:21
  • You should have a bind-address parameter on you my.cnf. Which version of mysql are you using? ubuntuserv is the hostname that is in the table user. Not sure of the content of yours, so do a Select * From User to check it. The idea is replace the content of host by % – Oscar Foley Dec 04 '12 at 11:23
  • I am having mysql installed with xampp pack in windows. I do not see bind-address in my.cnf – sushil bharwani Dec 04 '12 at 11:32
  • I didn't use xampp for a long time... Maybe file is named my.ini? or maybe there is an include to another config file (as they did several years ago in Apache) Are the other settings present in my.cnf (port, user...) ? – Oscar Foley Dec 04 '12 at 11:37
  • Or is possible that if setting is not there, it defaults to 127.0.0.1. You can try adding it. – Oscar Foley Dec 04 '12 at 11:37
  • Cool. Just curiosity... Where was your bind-address parameter hidden? – Oscar Foley Dec 04 '12 at 12:05
-1

Ask them to use phpMyAdmin to access your database over you IP address. Also put your Apache server online.

Uttam Kadam
  • 458
  • 1
  • 7
  • 20