-
Notifications
You must be signed in to change notification settings - Fork 471
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
MySQL connection failed #59
Comments
Hi @alex-sorochkin, cheers |
I have the same problem. The correct host is 'db' indeed, but in my case the database container isn't up. When I do a 'docker ps' I get only:
When doing docker-compose up: db_1 | chown: changing ownership of '/var/lib/mysql/': Operation not permitted this is on an osx host system |
Thanks a lot!!! It works now! |
Good news 😉 @11mb : please open another issue and don't forget to provide more details (i.e. configuration files, |
Hi Maxpou, thx for your work on this repo and your feedback! I opened a new issue #60. I found a walk-around by using a volume in docker-compose.yml. |
Hello!
I'm starting a new project using symfony and your containers. But I face with this error on establishing the MySQL connection:
SQLSTATE[HY000] [2002] Connection refused
I googled this issue and they suggest to use
localhost
instead of127.0.0.1
as a host. If I change this I get another error:SQLSTATE[HY000] [2002] No such file or directory
.I spent all the day trying to find the solution, but still no result. I tried all the combinations of hosts, ports, database name, also different usernames (root and user) - no result.
If I try to connest MySQL from command line - this works fine.
Not to have any config issues I was trying to create connection directly:
$conn = new \PDO('mysql:dbname=mydb;host=localhost;charset=UTF8;unix_socket=/var/run/mysqld/mysqld.sock', 'user', 'userpass');
- so I'm sure this is just connection issue, but not a symfony problem. I just tried to use socket as the guys recommended in StackOverflow.Do you have any ideas how to sort this?
Thanks, Alex.
The text was updated successfully, but these errors were encountered: