mysql (5.7.17) crashes on one specific query - mysql

We have one java application, which uses mysql db as back end.
Mysql 5.7.17 is installed on windows server 2012 R2 Standard
The issue is that our java application crashes mysql database,
We enabled logs and found out that there is this specific query that crashes mysql.
If I copy this query from the logs and run it in Workbench it crashes mysql and I get "Lost connection to mysql during query"
I tried increasing , max packet size, net read timeout to no avail.
To drill further , I installed same version mysql on another VM windows server 2012r2 standard , and here the query works fine, without any issues.
below is the query from the logs:
select userorgani0_.id as id1_16_,
userorgani0_.authority as authorit2_16_,
userorgani0_.organization_module_id as organiza3_16_,
userorgani0_.user_id as user_id4_16_
from user_organization_module userorgani0_
where userorgani0_.organization_module_id='2c9e85c75a4025ed015a402b72040004'
and userorgani0_.user_id='1rhdhdwi22c23214kcskcsk'
Could you please help me here.
regards,
RVS

Related

MS Access timeout getting a table

I'm using MS Access as frontend (in Windows), MySQL Server as DB (in RedHat) and ODBC to connect both.
I use linked tables in Access.
I have a huge table and always I try to get it, throw an exception:
"ODBC--call failed.
[MySQL][ODBC 8.0 (w) Driver][mysqld-8.0.16] Query execution was interrupted, maximum statement execution time exceeded (#3024)." (Always at 60 seconds)
I've tried everything. I can't find anything which can help me in the documentation or looking online.
I read post from years ago which mention to use "readtimeout or MYSQL_OPT_READ_TIMEOUT" in the registry editor (regedit.exe) and nothing. In the documentation appear that this option are not available since version 5.1.12.
I have no idea what can I do to delete or increase the timeout. Help!
Versions:
MySQL Server: 8.0.16 (Running on RedHat 7.5),
MS Access 365 (Running on Windows 10),
MySQL ODBC 8.0.15

mysql initial connection suddenly taking too long

I am using mysql 5.5.16 on windows 2008 R2 virtual server, and remotely connecting to it using C# and locally connecting to it using PHP. Its been working fine for past 5 month but suddenly today I started getting this error in C# code:
Timeout expired: The timeout period elapsed prior to completion of the operation or the server is not responding.
Also if I use HeidiSQL, its also talking more than a minute to connect, however, once connected, the queries are running without any delay. I have tried adding skip_name_resolve in the server's my.ini file but no use.

Lost connection to MySQL server at 'waiting for initial communication packet'

I have seen many stack overflows questions and some blogs tried workarounds, but nothings helped - hence re-posting the question with more details.
I am seeing the weird behaviour with MySQL and Python application, details are as follows:
1) My application works perfectly fine with MySQL (tried and tested on many platforms) but on this particular machine it fails to connect to MySQL.
structure of application is :
Windows service -> parent process -> Mysql(child process)
and when application tries to connect to MySQL it get this error:
ERROR 2013 , Lost connection to MySQL server at 'waiting for initial communication packet' - system error 0
I tried:
- connect_timeout=300
- skip-name-resolve=0
- firewall is OFF
- use 17.0.0.1, localhost , IP of machine to connect to but it still fails with same error.
2) Now the weird thing is -
If I manually follow all the steps which application does, It works perfectly fine, details are follows:
a) Start MySQL with same command (which application uses) with administrator privileges
mysql --default-file = xxx --basedir =xxx
b) Connect with same credentials ( -u root -P 6075 -h 127.0.0.1) and
It works perfectly fine, I double checked all the steps which application does, there is no difference between manually steps and application code.
AM I missing something here ? Any suggestions ?
MySQL version : 5.5.35
Python : 2.7
Base OS : Windows 2012 R2
Thanks in advance..
Found a reason - answering my question:
When I used to run MySQL from my application - it was running under system user privileges - so it used to pick "C:\WINDOWS\TEMP" as a temp directory- this directory was messed up - has lot of unnecessary files .. and MySQL was stuck while processing files under this directory...
But when I ran it manually under My administrator account it was using his temp directory... C:\Users\USER_NAME\AppData\Local\Temp and everything was working like magic...
To fix this permanently I changed tmp directory through MySQL conf file and now My Application runs like the Wind.... :)
[mysqld]
tmpdir = 'PATH_TO_THE_DIRECTORY'
I was getting this same error trying to set up a SQL Server Linked Server
Cannot initialize the data source object of OLE DB provider "MSDASQL" for linked server "DBLINKED".
OLE DB provider "MSDASQL" for linked server "DBLINKED" returned message "[MySQL][ODBC 8.0(w) Driver]Lost connection to MySQL server at 'waiting for initial communication packet', system error: 10060". (Microsoft SQL Server, Error: 7303)
You mentioned it in your initial question - the Connection Timeout was the issue for me.
The default is 0 - raised it to 300. I thought default of 0 would mean no timeout, but it's obviously something reasonably short, and I was trying to connect to a remote database on a slow internet connection. A lot of other question and answers out there relate to connecting within the same machine, so this error isn't reported much.

Same query times out - Lost connection to MySQL server during query

I know this question has been asked on here before, but it seems like I've tried everything suggested in this answer and this answer, and still no luck. I'm trying to use MySQL Workbench 6.3 on a Windows 10 client, connecting to a Linux MySQL server hosted by GoDaddy/cPanel.
I can connect to the MySQL server with no problems, and usually I have time to run a query or two. Then, within a minute of inactivity between Workbench and the server, I'll run into Error 2013: Lost connection to MySQL server during query. This even happens when running the exact same query, back to back about a minute apart, as shown here (even when the original query is quick; only 0.03 seconds to run):
The same problem persists when I run select sleep(60) immediately upon connecting to the MySQL Server; the connection is usually lost between 30-40 seconds into the execution of the query:
I've checked the MySQL docs, but with no luck. I don't think the problem can be related to packet size, as others have suggested (since the same query will work and then fail later), and my Workbench timeout settings look okay:
Anyone have any idea? The only other thing I can think of is maybe the wait_timeout variable listed in the MySQL docs needs to be increased too, but I guess that would be somewhere on the server side (some have mention my.ini) and I can't find where any MySQL Server files live in the cPanel hosting admin interface. There's a MySQL online client provided through cPanel (phpMyAdmin I think), but it's not nearly as robust and is becoming cumbersome to use. Any help would be appreciated!
I was having the same problem, using MySQL Workbench 6.3.6 on Win10 to connect to a MySQL server on a shared hosting system (Arvixe).
In addition to to the problem described by the OP (lost connection to server), I was also getting an error when attempting to import data from a prior export (similar to what is described here):
Unhandled exception: Error querying security information: Error executing 'SELECT * FROM mysql.user WHERE user = '[username]' and Host = '[host]' ORDER BY User, Host' SELECT command denied to user '[username]'#'[host]' for table 'user' SQL Error: 1142
Apparently, a bug was introduced in MySQL Workbench 6.3.5 (bug report). From the bug report:
It appears the problem arise if connecting with an user with no privileges on the mysql schema.
In other words: users connecting to a shared hosting system.
The proposed solution is to uninstall MySQL Workbench 6.3.6, and install 6.3.4 instead. (6.3.4 can be found in the archives). This solution worked for me.

Unable to connect to any of the specified MySQL hosts in NHibernate, MySql

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.