I have a Windows service (using .NET framework 4.5) installed on a Windows 2012 R2 machine. I have MySQL connector 6.9.7 and MySQL 5.6.25
When my service is started I am getting following error.
Authentication to host 'xxx.xx.x.xx' for user 'yyyyy' using method 'mysql_native_password' failed with message: Reading from the stream has failed. ---> MySql.Data.MySqlClient.MySqlException (0x80004005): Reading from the stream has failed. ---> System.IO.EndOfStreamException: Attempted to read past the end of the stream.
or sometimes:
Unable to connect to any of the specified MySQL hosts.
If I restart the service in a while all seems to work properly. Any idea what the problem is?
Migrating OP's solution from the question to an answer:
After further investigation we have found that our database version was 5.6.25. We have tried same connectivity with our old db 5.5.16 and we didn't face the same issue, so it looks like issue is the database itself. Our new database is installed on a Linux machine.
Related
After upgrading DataGrip to version 2021.3.2, my existing db connections were broken. I connect to various DBs (Oracle, MySql) via an SSH tunnel configured to connect through an AWS bastion host.
After the upgrade - DataGrip suggested that the MySql driver had to be updated to Amazon Aurora MySQL driver and it no longer worked to connect where it worked before the upgrade.
Switching between drivers I get two separate errors:
First Error using Amazon Aurora MySQL (suggested driver after update)
[08000][-1] Could not connect to address=(host=localhost)(port=53929)(type=master) : (conn=57522706) could not load system variables[08000][1220] (conn=57522706) Connection is closed.
and second error using original MySQL driver
[08S01]
Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
No appropriate protocol (protocol is disabled or cipher suites are inappropriate).
All of my connections worked immediately prior to the DataGrip upgrade - so seems that upgrade requires new drivers, which have a problem with the way I connect.
After some looking - it seems that Aurora has an existing race condition - found my answer here: https://jira.mariadb.org/browse/CONJ-824?focusedCommentId=165412&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-165412
My solution was to change my usePipelineAuth to false (not set prior) in the Advanced tab of the Data Sources configuration:
This fixed my connections and am back in business.
Finally, In my case, I fix the issue just replacing/using MariaDB Driver.
I installed Xampp and lauchd the Apache and MySQL services. After that, while installing the ZKTIME + WEB 2.0 and configuring the server to connect to MySQL DB, it says Unknown Error
Is there a way to fix this?
If you are connecting to OLD version DB then please note that Old and New version DB schemas are different. I am getting same error.
If you try to connect after installation through WDMS server Management. Connection will be made but the WEB portal won't work because of schema difference.
I tested my application on windows environment and it works fine. I have it set up on a remote linux server and suddenly I started getting the following error with one of the APIs while all the others work fine:
MySql.Data.dll Error : 0 : Unable to connect to any of the specif
ied MySQL hosts. MySql.Data.MySqlClient.MySqlException: Unable to
connect to any of the specified MySQL hosts.
any hint on why this could happen, connection settings are the same and nothing changed.
I have created a java application which connects to a mysql database using the JDBC driver. I have the mysql server running on the same machine as my java application.
When I connect to the database on localhost the application is working fine. My system in connected to other systems via LAN. Now i want to run my application on these systems connecting to the database on the mysql server i have on my system.
What changes do i need to make in my mysql workbench or the java application to deploy this. I have mysql 6.1 workbench installed.
I am getting the following error:
run: Communications link failure
Last packet sent to the server was 0 ms ago. Exception in thread
"AWT-EventQueue-0" java.lang.NullPointerException
at help.helpdesk.Ready(helpdesk.java:97)
at help.helpdesk.<init>(helpdesk.java:89)
at help.helpdesk$6.run(helpdesk.java:428)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122) BUILD
SUCCESSFUL (total time: 22 seconds)
when I try to connect to the database on my local server by using the ip address of my system.
If you set bind-address = 0.0.0.0 in /etc/my.cnf, MySQL will be available across all interfaces both locally and over the network.
You need to do following changes
1.Edit the my.cnf
mysql/my.cnf
change the local ip
bind-address = 192.168.1.2("your system ip")
2.restart the mysql server
and if you want connect to your database remotely than this link will helpful for you
I am attempting to connect R to a MySQL database via RODBC (in Win 7 environment), but cannot get past the following error:
[RODBC] ERROR: state IM014, code 0, message [Microsoft][ODBC Driver Manager] The specified DSN contains an architecture mismatch between the Driver and Application
After entering the following command:
odbcConnect(dsn,uid="My_UID",pwd="My_PWD")
I have successfully created a driver for the database by following the odbc wizard, and have installed the RODBC package into RStudio (ver 0.98.490). The MySQL is running on 32bit, I have the 32bit driver installed and working, and my RStudio is also 32bit. I know that the driver is working since both the test connection in config. works, as do queries run on excel using the driver.
What can I do to get the connection to work in R?
(Previous responses to this question seem to have been removed.)
Thanks in advance!
I faced a similar RODBC connectivity issue using DSN, where R was crashing abruptly without any logs/error trace. I tried with DSN-less ODBC connection API, it works fine.
odbcDriverConnect("SERVERNAME=;DRIVER={};DATABASE=;UID=;PWD=;")
Steps:
1. Install ODBC driver
2. Define VNode (host, listen address, protocol)
3. Use the odbcDriverConnect API
Docs:
http://cran.r-project.org/web/packages/RODBC/RODBC.pdf
http://cran.r-project.org/web/packages/RODBC/vignettes/RODBC.pdf
Hope this helps.