V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
MySQL 5.5 Community Server
MySQL 5.6 Community Server
Percona Configuration Wizard
XtraBackup 搭建主从复制
Great Sites on MySQL
Percona
MySQL Performance Blog
Severalnines
推荐管理工具
Sequel Pro
phpMyAdmin
推荐书目
MySQL Cookbook
MySQL 相关项目
MariaDB
Drizzle
参考文档
http://mysql-python.sourceforge.net/MySQLdb.html
colorsand
V2EX  ›  MySQL

mysql 不能远程连接

  •  
  •   colorsand · 2015-09-29 10:45:11 +08:00 · 2775 次点击
    这是一个创建于 3103 天前的主题,其中的信息可能已经有所发展或是发生改变。

    通过
    grant select,lock tables on discuz.* to ted@’ 115.28.36.60 ′ identified by ’ 123456 ′;
    授权之后,仍然不能连接,防火墙已经添加了 3306 端口的例外

    6 条回复    2015-09-29 20:55:19 +08:00
    mahone3297
        1
    mahone3297  
       2015-09-29 11:08:31 +08:00
    my.cnf 配置中,查看 bind
    colorsand
        2
    colorsand  
    OP
       2015-09-29 11:26:47 +08:00
    是 window 主机, my.ini 中绑定了 0.0.0.0,现在估计原因在网络层,访问外网 ip 的时候,可能没有将 3306 端口映射的内网主机。
    ftfniqpl
        3
    ftfniqpl  
       2015-09-29 12:35:29 +08:00
    grant 命令执行了之后,并不会马上生效,需要 flush privileges 或者 restart mysql 才能生效
    kohnv
        4
    kohnv  
       2015-09-29 12:35:51 +08:00
    上午刚试了试 mysql 的远程连接. 一开始也连不上, 后来发现是 windows 的防火墙没有添加 mysqld.exe
    thank243
        5
    thank243  
       2015-09-29 12:38:52 +08:00
    看看 my.cnf 里面的 bind 。
    goofansu
        6
    goofansu  
       2015-09-29 20:55:19 +08:00
    建议用支持 ssh 连接的软件, mac 的话用 Sequel Pro 。这样只要 ssh 账户就能登录数据库,随便你在哪个 ip 都不用设置权限
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1150 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 37ms · UTC 23:03 · PVG 07:03 · LAX 16:03 · JFK 19:03
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.