I have a situation where mysql is installed and when attempting to run a migration I get InvalidArgumentException:
[InvalidArgumentException]
There was a problem connecting to the database: SQLSTATE[HY000] [2002] No such file or directory
But I can connect to mysql find with the credentials, from command line
Can you please run phinx with -vvv (very verbose output) and paste the relevant error location in code?
Also, please paste your connection config (remove password though ;) ).
This error should only happen when you attempt to use the unix_socket config with an invalid path.
sample yaml
development:
adapter: mysql
host: localhost
name: development_db
user: root
pass: ''
port: 3306
charset: utf8
I will have the output you requested later.
@BardiaAfshin any follow up on this?
Not yet
Please reopen if you can provide more complete logging.
Hey there, I'm struggling with the same issue for all day long and I can't find a solution.
I'm on Mac OS
Edit : Found my solution : the problem was that I forgot to start MySQL server ! (I'm totally new to back-end and I feel stupid I didn't think about it)
Hi, I had the same issue when using phinx with mysql in a separate docker container. The cause was configuring the host as localhost in the phinx env file. After changing the host to 127.0.0.1 it worked!
Be
Hi, I had the same issue when using phinx with mysql in a separate docker container. The cause was configuring the host as localhost in the phinx env file. After changing the host to 127.0.0.1 it worked!
SO GOOOOOOOOOD. Worked for me
Most helpful comment
Hi, I had the same issue when using phinx with mysql in a separate docker container. The cause was configuring the host as localhost in the phinx env file. After changing the host to 127.0.0.1 it worked!