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

前端 未结 2 2043
独厮守ぢ
独厮守ぢ 2021-01-15 23:47

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 Databa

相关标签:
2条回答
  • 2021-01-16 00:13

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

    0 讨论(0)
  • 2021-01-16 00:19

    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.

    0 讨论(0)
提交回复
热议问题