I have a trivial VB script which I am using to connect to a MySQL database on a Windows Server (2012 R2).
It's all super simple, out of the box "connect to MySql example" stuff.
I have verified that MySQL is listening on all local IPV4 addresses. I can connect with MySQL workbench with the same parameters. Yet I get a weird error when connecting via my program:
An address incompatible with the requested protocol was used
My connect string is as follows:
"server=127.0.0.1;database=test;uid=xx;pwd=xx"
It appears the connection tries to use IPV6 when connecting. How is this possible?
I suspect some kind of firewall is modifying or blocking my network connection, but it is a "new" machine for me and I don't know what's installed.
The problem was due to an old MySQL Connector DLL (MySQL.Data.dll) version which was either incompatible with Windows (hence the networking error message) or the version of MySQL I'm running. After upgrading the dll, the connection worked properly.
This may help out someone who has a similar problem, as the error is highly misleading.
Related
Today a Microsoft Windows machine was unable to use the official MySQL client called "MySQL Connector/ODBC" to connect to a different MySQL server on a GNU/Linux machine, in the same LAN, via TCP/IP, standard port 3306, listening on all interfaces and without firewalls.
The connection from the Microsoft Windows client failed with this error message:
Connection Failed
[MySQL][ODBC 8.0(a) Driver] Can't open named pipe to host: xxx pipe: Mysql (s):
Notes
there is no firewall in the LAN
the port is worldwide opened
the credentials are OK
Question
Since this error message is nonsense... what's wrong here?
It seems there is a bug in the MySQL connector, at least version 8.0.
The client is ignoring your check on the TCP/IP option and it's using a legacy connection method called Named Pipe that it's not supported by your server (and should not - to be honest).
To make sure that the client does not use the Named Pipe method, select it, empty the text field (the one that in the example contains the text "Mysql"), and select again TCP/IP.
Now it will work!
It would be nice to discover if it exists an upstream bug in MySQL for that.
My workbench was previously working fine until recently, but I'm now getting the following error:
I'm not sure what's relevant so I'll list out everything that I think might be relevant:
My OS is Windows and I'm using JawsDB & Heroku as my server.
I've recently tried to mess with the my.cnf file (in an attempt to enable 'LOAD DATA LOCAL INFILE')
I think this is the extent to which I've used mysql_config_editor:
I've run "SET GLOBAL local_infile = true;" after logging in to my local sql.
I've checked numbers 1-4 on the error message. Here is an image of my connection to be sure:
I think I've messed with the NetBIOS at some point, and that might be a problem as discussed here, but I don't see "manage server instances" anywhere.
I'm not sure what else might be the issue here. Thanks in advance.
Edit: After trying to connect to the MySQL server through the command line, I get "ERROR 2003 (HY000): Can't connect to MySQL server on 'lyl3nln24eqcxxot.cbetxkdyhwsb.us-east-1.rds.amazonaws.com' (10060)", which seems to be an authentication error and not a connection error according to this link. But I'm unsure how to deal with this authentication error if it is one.
I'm not sure if this constitutes as an answer, but I've managed to establish a connection through my usual wifi (as opposed to a public school's wifi). It looks like either my security settings are different when on a public wifi or the public wifi itself had some sort of security setting that was blocking my connection.
I have access to 2 MySQL Servers (one for production and one for development). I have the host, port, database, user, password and the CA Cert file for them. I could connect to both using mysql workbench and from the windows cmd. (Yes, I have to work on windows for now)
Now according to security requirements, I need to connect using protocol TLSv1.2 or TLSv1.2, and Cipher AES256 and SHA2. These are currently not enforced on the development server, but they are on the production, and I am not able to connect on the production right now.
I satisfy AES256 and TLSv1.1 requirement.
But how do I get my client to connect using SHA2? Both Workbench and CMD doesn't work when I specify a cipher using both AES256 and SHA256 or SHA384. But it works fine if I specify something like AES256-SHA. Does this mean that it is not supported and I need to update something? By default, it uses 'DHE-RSA-AES256-SHA'
If I try to set one of the AES256-SHA2 cipher on the production, I get the error:
ERROR 2026 (HY000): SSL connection error: Failed to set ciphers to use
If I don't specify any ciphers, I get the error
ERROR 2026 (HY000): SSL connection error: unknown error number
I've looked up multiple posts on stackoverflow, mysql devs and mysql bugs website, and none seem to address this.
I have to ultimately get this to work with Ms. Access, since MySQL will be the backend for it. I even tried by creating a system DSN, but the same error pops up.
Maybe the ODBC Connector doesn't support SHA2? I couldn't find anything on this anywhere.
I have the latest version of ODBC and MySQL Workbench.
Turns out, the community versions(free) of MySQL Workbench and ODBC are compiled using yaSSL while the commercial versions use OpenSSL. And SHA2 is not supported by yaSSL. Once I got the commercial versions, I was able to connect using SHA2.
I am attempting to connect Tableau on a client (Windows 7) to a MySQL Server 5.6 (on Windows Server 2012 R2) that is hosting my data warehouse. This server is hosted on my university's network. Here is what I have done so far:
created a user that has privileges it needs (I ran GRANT ALL PRIVILEGES ON the user with FLUSH PRIVILEDGES, based on some other stack overflow posts)
made sure the host specified in the user table is "%"
made sure there was nothing in the my.cnf file that would prevent external connections (again based on another stackoverflow post)
ensured that the edition of MySQL running on the server is 64 bit, like the version of Tableau I'm running
I still get the "[MySQL][ODBC 5.3(w) Driver]Host 'vpn240-74.vpn.utah.edu' is not allowed to connect to this MySQL server" error. This same error is thrown when I try to telnet to the port on the server MySQL is listening on.
I have found that this error persists whether I am connected via a vpn or on campus. I can RDP to the server in question, ping it, and found the firewall rule for the port I am using, so I don't think there is anything network related that is stopping me.
All my stackoverflow research says that error means MySQL is convinced that the user is not allowed to connect from that specific hostname, but I get the same error whether I change the entry in the user table to be "%" or the specific hostname from the error message.
Also I see that the Tableau MySQL driver I installed is a lower version number than the MySQL instance I'm trying to hit (5.3 vs 5.6) but that is the newest driver on the Tableau site that I can find.
Any help greatly appreciated.
Have you tried making an ODBC connection in your computer to your MySQL server and testing it that way?
Tableau can then connect via an ODBC connection made rather than the explicit Tableau MySQL driver. In Tableau under More Servers... Other Databases (ODBC) shows up at the very bottom.
One of the client is reporting this issue happening in our application. NHibernate throws Unable to connect to any of the specified MySQL hosts in the middle of the app running, so it is not a mistake in the configuration. It happens randomly, but always when the transaction is opened.
I saw this:
NHibernate, MySQL, Windows Server 2003 -- connection problems
But the server in my case is Windows 2008. And app opens only single connection simultaneously. MySQL version is 5.5.28. Server is on the remove machine
Unfortunately the app requires the HW I do not have, and I cannot reproduce it locally.
Any ideas or directions I need to dig in?
Try connecting using the full directory name, e.g. instead of Server=SRV use
Server=SRV.yournetwork.com
It might be that is has trouble resolving the server name.