简体   繁体   English

MySql远程服务器连接访问被拒绝

[英]MySql Remote server connection access denied

I have created a free application using openshift , and created MySQL and phpmyadmin cartridges and inside my phpmyadmin I have gave access to all users from anywhere with all privileges now the problem is when I try to connect from my local MySQL workbench i get connected but I don't see my tables I have created in remote server using phpmyadmin and I can't do any action at all like creating schemas or tables where i get 我已经使用openshift创建了一个免费的应用程序,并创建了MySQL和phpmyadmin卡式盒,并且在phpmyadmin内部,我可以使用所有特权从任何地方访问所有用户,现在的问题是,当我尝试从本地MySQL工作台进行连接时,我可以连接了,但是我看不到我使用phpmyadmin在远程服务器中创建的表,并且根本无法执行任何操作,例如在我得到的地方创建模式或表

ERROR 1044: Access denied for user ''@'localhost' 错误1044:对用户``@'localhost'的访问被拒绝

Remember that I allowed all privileges for any user, but I still get access denied for any action except only for the database connection. 记住,我允许任何用户使用所有特权,但是除了数据库连接之外,我仍然拒绝执行任何操作。

Make sure the user you've given full permissions to is the same user MySQL Workbench is connecting as -- there's a difference between the hosts % and localhost for instance. 确保您拥有完全权限的用户与MySQL Workbench正在连接的用户相同-例如,主机%localhost之间存在差异。 From MySQL Workbench, issue the "Status" command and compare the username and host against what you've configured. 在MySQL Workbench中,发出“状态”命令,并将用户名和主机与您配置的内容进行比较。

You're apparently connecting through 'localhost' so you have to give full permissions to the anonymous user with host localhost (or change your connection type to tcp so that your connection is via 127.0.0.1 instead of localhost). 您显然是通过“ localhost”进行连接的,因此必须向具有主机localhost的匿名用户授予完全权限(或将连接类型更改为tcp,以便您的连接通过127.0.0.1而不是localhost)。

Edit for further clarification: The MySQL permission structure treats different types of connections differently; 编辑以进一步澄清: MySQL权限结构以不同方式对待不同类型的连接。 a client connecting via TCP connection always appears to come from an IP address, even if it's from the "local host" (in the sense of being on the same machine), in which case that IP address of the incoming connection may be 127.0.0.1. 通过TCP连接进行连接的客户端似乎总是来自IP地址,即使它来自“本地主机”(在同一台计算机上),在这种情况下,传入连接的IP地址可能是127.0。 0.1。 Socket type connections are registered in MySQL as coming from the host "localhost" (literally, in this case). 套接字类型的连接在MySQL中注册为来自主机“ localhost”(在本例中为字面意思)。 This is why we're verifying which host MySQL Workbench is connecting as. 这就是为什么我们要验证MySQL Workbench连接的主机。

Different connection types appear differently to MYSQL even if they're coming from the same "local machine." 即使不同的连接类型来自同一“本地计算机”,它们的显示方式也与MYSQL不同。 Furthermore, the wildcard host does not include 'localhost' socket connections, those are a separate entry in the permissions field with the 'localhost' host name; 此外,通配符主机不包括“ localhost”套接字连接,它们是权限字段中带有“ localhost”主机名的单独条目; the wildcard does not apply, as I explained above. 如上所述,通配符不适用。 This is the reason why we're checking which permissions you set against what MySQL Workbench is connecting as; 这就是为什么我们要检查针对MySQL Workbench连接所设置的权限的原因。 it's the most common cause of difficulties such as these. 这是造成此类困难的最常见原因。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM