-
Notifications
You must be signed in to change notification settings - Fork 9.4k
[PDOException] SQLSTATE[HY000] [2002] No such file or directory #5173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@Onkovat, thank you for reporting! Could you please provide description according to the template to allow us research this issue? |
andimov, I'm really not sure what to write into the template:
Expected result
Actual result
I can't install from development branch since I do not know how to do it. I installed the newest 2.0.7 version of magento though. The shop is on a subdomain of a topleveldomain. I can log in via SSH and can run commands like magento deploy:mode:show successfully and I could change it to developer mode. Though it does not work to run a command like magento cache:flush in terminal. Because always the error message `[Zend_Db_Adapter_Exception] [PDOException] cache:flush [--bootstrap="..."] [types1] ... [typesN]` appears. What I found and did in trying to solve it is this: Now I have read this article http://devdocs.magento.com/guides/v2.0/install-gde/trouble/php/tshoot_phpini.html And really, the Loaded Configuration File had a different path. Now this was changed. It is still a bit different like /opt/phpfcgi-5.6/lib instead 5.6.22 but the previous dir is a redirect to the first one so they are the same files. I guess that would not mean problems, right? I found now that here it is suggested that it might be a cookie problem: #737 (comment) It's true that I run my magento on a subdomain though I can't change that in order to test if it would be a solution. And it would be no real solution anyway from a magento dev point of view. I think it might be that the subdomain can be a problem though I think that should not happen because it should be quite normal to run a magento shop on a subdomain. Otherwise I do not have a clue about what could be wrong. I'm not sure if you can follow the trails this way but what I did was only installing the magento on that subdomain. |
Andrii Kasian I noticed in the other thread that you suggested as the solution to move the shop to a maindomain and that it might have to do with cookies and such. I don't have a clue how this could be related but I can not move my shop to a main domain. So can you help to solve the issue in another way maybe? |
Probably no bug... It seems I had no access to the database through terminal. I'm not really experienced with unix so I thought the error has to lie in magento. :| |
After a lot of struggle I finally fixed the issue of SQLSTATE[HY000] [2002] No such file or directory on MAC MAMP server. I create /etc/my.cnf file and make an entry of following line of code 👍 [mysqld] [client] This I created the /.bash_profile and make an entry of export PATH=/Applications/MAMP/bin/php/php7.0.15/bin:/Applications/MAMP/Library/bin:$PATH Then It start work! |
I had this same issue due to multiple versions of PHP on my mac, |
yeah the solution of @sagarppanchal and @dswtpvtltd will help to resolve this issue. I found a better way to resolve this issue is: get error: SQLSTATE[HY000] [2002] No such file or directory
ln -s /Applications/MAMP/tmp/mysql/mysql.sock /tmp/mysql.sock The cause of my case is Mamp install mysql and socket in other directory and Magento 2 looking mysql.sock in default place. So we just need to link the default place to Mamp place. This will resolve this issue. I noted some other issues I got when install mamp here: |
Goto
That worked for me |
Why does this work? |
I'm using Magento 2.0.7 and I ran into this error that I can't find to resolve.
It happenes when on terminal via SSH I try to run a simple cache flush command. The error message is:
`[Zend_Db_Adapter_Exception]
SQLSTATE[HY000] [2002] No such file or directory
[PDOException]
SQLSTATE[HY000] [2002] No such file or directory
cache:flush [--bootstrap="..."] [types1] ... [typesN]`
When I let magento show that I run in dev mode then nothing happens.
Now I have read this article http://devdocs.magento.com/guides/v2.0/install-gde/trouble/php/tshoot_phpini.html
And really, the Loaded Configuration File had a different path. Now this was changed. It is still a bit different like /opt/phpfcgi-5.6/lib instead 5.6.22 but the previous dir is a redirect to the first one so they are the same files. I guess that would not mean problems, right?
I found now that here it is suggested that it might be a cookie problem: #737 (comment)
It's true that I run my magento on a subdomain though I can't change that in order to test if it would be a solution. And it would be no real solution anyway from a magento dev point of view.
So how can I solve this then?
Thanks!
The text was updated successfully, but these errors were encountered: