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
cicada
V2EX  ›  MySQL

MySQL 命令行客户端无法连接远程服务器,Navicat 可以

  •  
  •   cicada · 2019-07-29 16:48:04 +08:00 · 4278 次点击
    这是一个创建于 1704 天前的主题,其中的信息可能已经有所发展或是发生改变。
    HomeBrew 安装的 MySQL,MySQL 客户端无法连接公网 MySQL 服务器,同样的连接参数,Navicat 可以连接.
    终端连接:mysql -h 主机 IP -u 用户名 -p
    错误提示:ERROR 1045 (28000): Access denied for user 'xx'@'xxx.xxx.xxx.xxx' (using password: YES)
    其中错误提示里的 xxx.xxx.xxx.xxx 是我本机出口的公网 IP(也就是路由器的公网 IP),而不是我-h 参数制定的目标服务器 IP
    请问这是咋回事?
    3 条回复    2019-07-29 21:05:56 +08:00
    isbarton
        1
    isbarton  
       2019-07-29 18:11:41 +08:00
    找到 my.cnf 文件。在 client 部分,把 host,user,password 添加进去,然后直接执行 mysql 看看。
    qza1212
        2
    qza1212  
       2019-07-29 21:04:29 +08:00
    用户权限问题,你 navicat 用的用户名跟 shell 里不一定是同一个
    taotaodaddy
        3
    taotaodaddy  
       2019-07-29 21:05:56 +08:00 via Android
    用户要有远程权限的缘故?
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3077 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 12:45 · PVG 20:45 · LAX 05:45 · JFK 08:45
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.