Missing mysql.sock while connecting mysql in Centos - mysql

I'm trying to connect to mysql in Centos. I was using this normally. But this morning i wasn't able to connect. Looked through various links on internet and got to know i'm missing mysql.sock. I looked through find command but all in vain.
Error:
Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

Not exactly answer. But reverted back to previous state using snapshot. And problem got solved.

Related

Can't connect to local MySQL server through socket on new openshift

I am trying to set up the same instance of redmine I had running on the old openshift. I have set up everything as far as I understand but I am not great at this and I think I have configured the database incorrectly.
My database config is here
https://github.com/Dunkhan/Redmine/blob/master/config/database.yml
The error I get is
Mysql2::Error: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
I know there are a lot of questions already posted with this error but most of them involve php so none of those solutions are applicable, in addition, these questions are mostly several years old and openshift has completely changed recently. I tried some of the solutions like changing to root user for mysql, and adding in the port to the config, but nothing has worked so far.

Local wordpress issues: Mac MAMP

I'm having some issues with my local environment. I had setup a wordpress site locally on my Mac through MAMP. All was working well until my computer powered down (not plugged into power source). Now there appears to be issues with the database. When i run MAMP and try to connect I get the error "Error establishing Database Connection". Also when i go through the MAMP portal at localhost and click on Tools > PHPMyAdmin I get the following error:
MySQL said: Documentation
#2002 - No such file or directory — The server is not responding (or the local server's socket is not correctly configured).
mysqli_real_connect(): (HY000/2002): No such file or directory
Obviously something has gone very wrong with the database connection but do not know how to resolve. I have tried to run some scripts in terminal to stop mysql process to no avail so far.
Any advise appreciated. I have looked at some similar but not exact other posts and does not seem to resolve.
Note: The ports changed at some point in the process, but everything else seems fine related to the new port setup but this may be relevant
thanks
While, I'm not sure of the cause. FINALLY found a solution to this very frustrating issue.
What ended up working for me is to uninstall the new version 4.2.1
I did this through first going to the MAMP PRO folder and using the MAMP Pro uninstaller and then moving the Mamp and Mamp pro folder to the trash.
I then went and found the old version to install
https://www.mamp.info/en/downloads/older-versions/
When I downloaded 3.5.2 whatever issues it was having with local databases were resolved. Go figure! Glad to finally have resolved not sure why this would happen other than perhaps a bug in the new version.
Thanks to those who pointed out some possible things to look at
I'm running MAMP 4.0.6 and getting the same error on local wordpress installations, and same error message as described when trying to go to phpmyadmin on MAMP.
The reason seemed to be that the mysql server does not start. The solution that worked for me is offered in this reply in another thread:
https://stackoverflow.com/a/45582509/4623519
Quit MAMP. In the finder go to Applications/MAMP/db/mysql/. Delete the last log file (look for a file named ib_logfileN – being N the log number Eg-ib_logfile0 and ib_logfile1) Nice screenshot provided in link above.
This seems to be happening often according to this post from 2013.

Problems with mysql config - want to understand

i know that there are many questions which are connected with my question, but nothing helps me to come to my goal.
I'm on mac osx 10.10.4
in the past i had MAMMP installed on my mac. Later i deleted it to configure my local hosts by my own. In the meantime i use vagrant for this. But i want to understand how the local mysql config works.
My problem:
If i type "mysql -uroot" i get this error:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/Applications/MAMP/tmp/mysql/mysql.sock' (2)
The /Applications/MAMMP/.. folder are deleted and not there. So i think there must be a config file where this is inserted. But i cant find this file. Not in /etc/my.cnf and not in /usr/local/mysql/support-files/... nowhere...
Could anyone give me hints where my config for that is destroyed and how i can reapair it?
Would be great to hear from you guys. Thanks

connection refused mysql node.js

I've tried everything under the sun to fix this problem, nothing works!
I'm trying to connect to mysql using node.js.
I've tried both normal connections and pool connections, but I keep getting the following error:
"connect ECONNREFUSED"
I'm working on a Windows 7.
There are many similar questions to this on Stack Overflow, and everyone mentions the mysql configuration file (and commenting out "skip-networking"), however, I can't find where the file is (the mysql module was installed under node_modules).
I've tried looking for my.ini and my.cnf, there don't seem to be on my machine either.
Is there a way to try to log in to mysql via the command line?
It seems like there isn't since the command line doesn't recognize the command "mysql".
I'd post the code that I've been using but that wouldn't help, since I've been using dozens of different alterations, and all fail.
Thanks in advance, I appreciate the help!
Thanks to Салман, I realized that I need to install the actual MySQL server as well.

mysql over SSH tunnel

I'm having an issue on both a win7 development machine, and on a windows 2008 production server with connecting to a remote Suse Linux server to mysql over SSH. I've followed the very simple instructions here.
http://realprogrammers.com/how_to/set_up_an_ssh_tunnel_with_putty.html
only on the last step, i'm trying to use the odbc connector that I downloaded from here.
http://dev.mysql.com/downloads/connector/odbc/
trying both localhost:3306 and 127.0.0.1:3306 doesn't seem to make a difference. I CAN log into the linux server in putty over ssh, and use the command line from the terminal to connect to mysql. My issue is that I need the windows server to be able to connect and query data from the mysql instance on the linux server. When I attempt to connect from the odbc connector it immediately pops up an error that root#localhost is denied with password=YES. I've checked my user table in mysql and root is set to allow login from any host, including localhost. Anyone have any other suggestions for getting this to work? It's quite urgent as we need to plan for a data synchronization of several gigs by this Saturday. Thanks in advance for any help.
Okay, I figured this out... You have to run putty.exe as an administrator. Once I did that the connection worked just fine. Hopefully this saves someone a few hours of work down the road. Thanks to bfavaretto for his help.