MySQL: How to allow remote connection to mysql

后端 未结 16 1128
北海茫月
北海茫月 2020-11-21 06:15

I have installed MySQL Community Edition 5.5 on my local machine and I want to allow remote connections so that I can connect from external source.

How can I do that

相关标签:
16条回答
  • 2020-11-21 07:00

    some times need to use name of pc on windows

    first step) put in config file of mysql:

    mysqld.cnf SET bind-address= 0.0.0.0

    (to let recibe connections over tcp/ip)

    second step) make user in mysql, table users, with name of pc on windows propierties, NOT ip

    0 讨论(0)
  • 2020-11-21 07:04

    And for OS X people out there be aware that the bind-address parameter is typically set in the launchd plist and not in the my.ini file. So in my case, I removed <string>--bind-address=127.0.0.1</string> from /Library/LaunchDaemons/homebrew.mxcl.mariadb.plist.

    0 讨论(0)
  • 2020-11-21 07:11

    All process for remote login. Remote login is off by default.You need to open it manually for all ip..to give access all ip

    GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'password';
    

    Specific Ip

    GRANT ALL PRIVILEGES ON *.* TO 'root'@'your_desire_ip' IDENTIFIED BY 'password';
    

    then

    flush privileges;
    

    You can check your User Host & Password

    SELECT host,user,authentication_string FROM mysql.user;
    

    Now your duty is to change this

    bind-address = 127.0.0.1
    

    You can find this on

    sudo nano /etc/mysql/mysql.conf.d/mysqld.cnf
    
    

    if you not find this on there then try this

    sudo nano /etc/mysql/my.cnf
    

    comment in this

    #bind-address = 127.0.0.1
    

    Then restart Mysql

    sudo service mysql restart
    

    Now enjoy remote login

    0 讨论(0)
  • 2020-11-21 07:11

    For whom it needs it, check firewall port 3306 is open too, if your firewall service is running.

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