[英]MySQL - ODBC connect fails, Workbench connect works
I am trying to install and test a MySQL ODBC Connector on my machine (Windows 7) to connect to a remote MySQL DB server, but, when I configure and test the connection, I keep getting the following error:我正在尝试在我的机器 (Windows 7) 上安装和测试 MySQL ODBC 连接器以连接到远程 MySQL 数据库服务器,但是,当我配置和测试连接时,我不断收到以下错误:
Connection Failed
[MySQL][ODBC 5.3(w) Driver]Access denied for user 'root'@'(my host)' (using password: YES):
The problem is, I can connect with MySQL Workbench (remotely - from my local machine to the remote server) just fine.问题是,我可以很好地连接 MySQL Workbench(远程 - 从我的本地机器到远程服务器)。 I have read this FAQ extensively but it's not helping out.
我已经广泛阅读了这个常见问题,但它没有帮助。 I have tried:
我试过了:
What is frustrating is that I can connect with MySQL Workbench on my local machine (with the same IP/user/password), just not with ODBC.令人沮丧的是,我可以在我的本地机器上连接 MySQL Workbench(使用相同的 IP/用户/密码),只是不能使用 ODBC。
What could I be doing wrong, or what could be messing up my attempt to connect with ODBC?我可能做错了什么,或者什么可能会破坏我与 ODBC 连接的尝试?
Update : I managed to set up the ODBC driver and get it running correctly on the server side.更新:我设法设置了 ODBC 驱动程序并让它在服务器端正确运行。 I can connect there to the localhost using a command line (with the "isql" command).
我可以使用命令行(使用“isql”命令)连接到本地主机。 But I still can't connect over remotely with my Windows 7 machine.
但是我仍然无法通过我的 Windows 7 机器远程连接。
Solved.解决了。
As it turns out, it was a permissions problem.事实证明,这是一个权限问题。 I ran the following command on the remote server SQL:
我在远程服务器 SQL 上运行了以下命令:
GRANT ALL PRIVILEGES ON *.* TO 'root'@'(my_host)' IDENTIFIED BY '(my_password)';
I had run the previous command, but without the "IDENTIFIED BY" password.我已经运行了上一个命令,但没有“IDENTIFIED BY”密码。 Then, to reset the mysql permissions cache, I also ran
然后,为了重置 mysql 权限缓存,我也跑了
FLUSH PRIVILEGES;
And now it works.现在它起作用了。
也只适用于 64 位 odbc 驱动程序而不适用于 mySQL 32 位。
We had a similar case that 'user'@'%' was granted at server but ODBC connect failed at a PC while workbench connect successfully.我们有一个类似的情况,即在服务器上授予了 'user'@'%' 权限,但 ODBC 连接在 PC 上失败,而工作台连接成功。
MariaDB 10.0.31, MySQL ODBC 3.51, MySQL Workbench 8.0 MariaDB 10.0.31、MySQL ODBC 3.51、MySQL 工作台 8.0
Solved by install MariaDB Connector/ODBC 3.1 instead of the MySQL ODBC ( https://downloads.mariadb.org/connector-odbc/ ).通过安装 MariaDB Connector/ODBC 3.1 而不是 MySQL ODBC ( https://downloads.mariadb.org/connector-odbc/ ) 解决。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.