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

落花浮王杯 提交于 2019-12-04 02:05:57

问题


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?


回答1:


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.




回答2:


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



来源:https://stackoverflow.com/questions/13701363/how-to-make-mysql-database-at-my-local-accessible-from-different-machines

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!