Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mysql 端口映射遇到问题了 #7

Closed
harvies opened this issue Sep 12, 2017 · 7 comments
Closed

mysql 端口映射遇到问题了 #7

harvies opened this issue Sep 12, 2017 · 7 comments

Comments

@harvies
Copy link

harvies commented Sep 12, 2017

ssh web都正常 MySQL 连接不知道为什么就变localhost了
mysql -u test -D aaa -h xxxxx.com -P 3381 -p
ERROR 1045 (28000): Access denied for user 'hztest'@'localhost' (using password: YES)

@ffay
Copy link
Owner

ffay commented Sep 12, 2017

应该是密码错误

@harvies
Copy link
Author

harvies commented Sep 12, 2017

密码是对的,我把域名和端口换了就能连上

@cookier
Copy link

cookier commented Sep 12, 2017

我刚才自己试验了,通过navicat连接是没有问题的。
命令行为mysql -u root -h a.lanproxy.org -P 3078 -p
你这是属于mysql用户连接权限没有配置好的问题。可以把-D aaa 去掉。

@harvies
Copy link
Author

harvies commented Sep 12, 2017

@cookier 去掉-D 也一样的错 但是用 ddns是可以连接的

@cookier
Copy link

cookier commented Sep 12, 2017

他这个程序是没问题的,做的只是转发的操作。我不知道你说的ddns连接是什么意思,这里mysql的提示很明显,你查看下hztest用户是否有本地连接数据库的权限。

@harvies
Copy link
Author

harvies commented Sep 12, 2017

@cookier 谢谢,我知道什么意思了 这个程序是通过localhost访问的数据库,而我以前是通过远程访问的,难怪提示localhost拒绝访问

@harvies
Copy link
Author

harvies commented Sep 12, 2017

已经连上了

@harvies harvies closed this as completed Jun 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants