MySQL社区

 找回密码
 注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

搜索
查看: 1306|回复: 0

[权限及安全] MySQL本地连接上,但远程可以连接上

[复制链接]
发表于 2017-8-21 17:06:25 | 显示全部楼层 |阅读模式
本地不管用root还是其他账号,都连接不上Mysql
C:\Program Files\MySQL\MySQL Server 5.7\bin>mysql -uroot -p
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

但是远程,除了root,其他账号都可以连接上Mysql
C:\Program Files\MySQL\MySQL Server 5.7\bin>mysql -h10.10.10.1 -uoba -p123456
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 461
Server version: 5.6.24-log MySQL Community Server (GPL)

完全不清楚本地为什么连接不上Mysql。。。

然后,又通过show variables like '%datadir%'查看数据所在的目录,如下
mysql> show variables like '%datadir%';
+---------------+-----------------------------------------------------------------------------------+
| Variable_name | Value                                                                             |
+---------------+-----------------------------------------------------------------------------------+
| datadir       | C:\Documents and Settings\All Users\Application Data\MySQL\MySQL Server 5.6\Data\ |
+---------------+-----------------------------------------------------------------------------------+
1 row in set (0.00 sec)


在这个目录下找出user.frm,user.myd,user.myi复制到另外一台pc的非mysql的schema上,查到只有root的账号,没有其他账号,我就更不明白为什么连账号都没有,远程却可以连接上mysql.

有哪位大神能告诉我这是什么问题?
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|申请友链|小黑屋|Archiver|手机版|MySQL社区 ( 京ICP备07012489号   
联系人:周生; 联系电话:13911732319

GMT+8, 2024-4-18 13:05 , Processed in 0.063831 second(s), 24 queries , Gzip On.

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表