Cannot connect to Mysql From Rails Application - mysql

I am having my application and database hosted in EngineYard. Suddenly my application is down. I am getting this error when I looked into the log
Mysql2::Error: This connection is still waiting for a result, try again once you have the result
I tried to run some read queries from Rails console in Staging. This is working fine. Database queries returns the expected answers.
Also I checked out the Staging branch in local and checked. I could not reproduce the error in my local. So I assume there is no error in the code.

Restarting the App Server worked for me.
Syntax:
ey ssh "/engineyard/bin/app_<appname> restart" -e your_env_name --app-servers
Reference:
Engineyard command line: ey web restart not working

Related

MySQL Workbench Failing to Connect to Server (Windows)

There are many errors I have found across the web that deal with MySQL connection errors, but I have found none that address this specific problem that I am having. In short, I have the newest version of the MySQL Server installed (8.0), I have verified it is running in my Services tab, and I can connect to the server via the MySQL client just fine. However, I cannot open a local connection in Workbench.
When I click on the local instance, it hangs until I manually stop it. I then get the aforementioned error
I then went and ran a diagnostic of the server in the MySQL Installer, which reported that everything is working fine (unless I am reading it wrong)
The logs of said diagnostic also report that the server is installed, functional, and running.
I then checked made sure the server was running in Services
After that, I verified that I could connect to the client, and that I could use the database I was working with (info redacted due to it being company property lol)
Additionally, I also made a new connection on Workbench on port 3307 instead of the standard 3306.
When I click on this, I can enter into the connection without getting the "Cannot access a disposed object" error. However, this connection still cannot connect to the server.
I also saw that some people were having success by navigating into C:\Program Files\MySQL\MySQL Server 8.0\bin and running mysqld --install. This appeared to be beneficial, but ended up doing nothing.
Does anyone know how I can fix this without completely uninstalling everything? Everything was working fine yesterday but has suddenly stopped as of this morning.

Gulp 4 task with node-mysql2 module causing server crash on connect

I have a need to run mysql queries within gulp to check certain fields in a table. I currently connect to a development server via ssh tunnel, which is opened via terminal so that my host is set to 'localhost'.
When I execute a connection attempt, the tunnel crashes with:
channel 4: open failed: connect failed: Connection refused
Then the server process crashes with an out of memory error.
We use node-mysql2 and a ssh tunnel to run GraphQL locally for testing, so I can't think of anything in particular in gulp that would cause what is essentially a race condition almost instantaneously from the time that the gulp command is sent.
Gulp Code:
If anyone has any insights I'd be much obliged.
Fix can be found here, thanks to the mysql2 developer for pointing me in the right direction!
More info on fix here:
https://stackoverflow.com/a/30669454/705115

Can't connect to MySql DB through ssh usign Workbench after update

I'm facing a strange problem here...
My database is in a AWS EC2 and I was used to connect to it through SSH using MySql Workbenh.
To do it, I generated a passphrase protected ppk file using puttygen on ubuntu 16.04 and it worked fine.
But after an update, using the same configuration, I receive this error message:
Could not connect the SSH Tunnel
Authentication error. Please check that your username and password are
correct and try again. Details (Original exception message): Bad
authentication type, the server is not accepting this type of
authentication. Allowed ones are: [u'publickey']
So, searching on Google I found this two guys with the same problem: this, and this.
The solution proposed is generate a public open-ssh file and use it, then it was I did:
puttygen myKey.ppk -O public-openssh -o myKey.ppk
And the problem stills the same! I'm not sure if the Workbench update (it is in 6.3.10 version now) caused this issue, but before that I could connect with no problems.
I can connect normally in server through ssh in ubuntu terminal.
What I can do?

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.

phpmyadmin Error #2003 the server is not responding

after battling my way through every error message to try and get phpmyadmin running I am finally stumped by the last message. #2003 - The server is not responding. I think I know that its a problem between phpmyadmin and my installation of MySQL but I just cant find the hook.
I have already set the socket in the config.inc.php. I don't care if it works remotely i just need it to run locally for now. MySQL client connects just fine. I can do stuff from the command line so I know MySQL is configured and running. running typical LAMP stack CentOS 7 and mariadb. MySQL port is 3306
socket=/var/lib/MySQL/MySQL.sock (the stackoverflow web form keeps changing the case of MySQL so I am aware of the case sensitivity)
the main login page comes up fine but gives the 2003 error after typing in password. I know the correct password and I am typing it in correctly.
any help appreciated.