简体   繁体   English

用于MySQL访问的Toad被拒绝但Workbench连接正常

[英]Toad for MySQL Access Denied But Workbench connects fine

I am trying to use TOAD to connect to a remote mysql server but keep getting access denied for 'user@laptop-hostname'. 我正在尝试使用TOAD连接到远程mysql服务器,但继续拒绝访问'user @ laptop-hostname'。

Which would make me think that this is a permissions issue except for the fact that I can connect with MYSQL Workbench without problems. 这会让我觉得这是一个权限问题,除了我可以毫无问题地连接MYSQL Workbench。

The other weird thing is that I can connect to see the tables and get a list of DBs with TOAD but when I go to do a snapshot or compare I get an access denied error. 另一个奇怪的事情是我可以连接查看表并获取带有TOAD的DB列表但是当我去做快照或比较时我得到访问被拒绝错误。

Error: 错误:

"SELECT command denied to user 'MY-USER'@'MY-LOCAL-HOSTNAME' for table 'db' Quest.Compare.Schema.MySQl.DBModel

Any ideas? 有任何想法吗?

EDIT: I should also mention that I can execute queries fine using TOAD. 编辑:我还应该提一下,我可以使用TOAD执行查询。 Seems to be a problem with snapshot and compare. 似乎是快照和比较的问题。

I recently had to fix this myself. 我最近不得不自己解决这个问题。 In this case, the DB table toad is referring to is the DB table of the mysql schema. 在这种情况下,DB表toad是指mysql架构的DB表。 To fix this, just add a grant permission to MY-USER like so: 要解决此问题,只需向MY-USER添加授权权限,如下所示:

GRANT SELECT ON 'mysql'.'db' TO 'my-user'@'my-local-hostname';

So, error means that you can connect to the server using specified account (MySQL user), but user does not have required privileges. 因此,错误意味着您可以使用指定的帐户(MySQL用户)连接到服务器,但用户没有所需的权限。

Try to connect as root , and grant SELECT privilege to user 'MY-USER'@'MY-LOCAL-HOSTNAME'. 尝试以root身份连接,并将SELECT权限授予用户'MY-USER'@'MY-LOCAL-HOSTNAME'。 You can grant global-level SELECT privilege, database-level or table-level. 您可以授予全局级SELECT权限,数据库级或表级。 For example - 例如 -

-- Global level
GRANT SELECT ON *.* TO 'MY-USER'@'my-local-hostname';

-- Database level
GRANT SELECT ON <database_name>.* TO 'MY-USER'@'my-local-hostname';

-- Table level
GRANT SELECT ON TABLE <database_name>.<table_name> TO 'MY-USER'@'my-local-hostname';

Then reconnect as 'MY-USER'@'my-local-hostname' again. 然后再次重新连接为'MY-USER'@'my-local-hostname'。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Rails连接到Mysql时“访问被拒绝” - “Access Denied” when rails connects to Mysql 对C#应用程序的MySQL访问被拒绝但对工作台没有访问权限 - MySQL access denied to C# app but not to workbench MySQL - 访问被拒绝,直到我通过 Workbench 或 CLI 连接 - MySQL - access denied until I connect via Workbench or CLI 访问被拒绝使用MySQL WorkBench生成的PHP连接到数据库 - Access denied connecting to database using PHP generated by MySQL WorkBench 无法创建ipc端口; MySQL Workbench中拒绝访问 - Failed to create an ipc port; access is denied in MySQL Workbench 在MySQL工作台中执行GRANT命令时拒绝用户访问 - Access denied for user while executing the GRANT command in MySQL workbench 如何解决“mysql工作台窗口中用户&#39;root&#39;@&#39;localhost&#39;的访问被拒绝” - How to resolve “access denied for user 'root'@'localhost' in mysql workbench windows” 我的应用程序拒绝了MySQL Access,但其他应用程序正常运行 - MySQL Access denied for my application, but others work fine Ubuntu上所有帐户的MySQL访问被拒绝,但是PHPMyAdmin可以正常工作吗? - MySQL access denied for all accounts on Ubuntu, yet PHPMyAdmin works fine? “无”拒绝访问。 尝试使用 RStudio 通过 SSH 访问 MySQL Workbench 数据库 - Access denied for 'none'. Trying to access a MySQL Workbench database via SSH using RStudio
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM