I'm attempting to connect to a database through ssh tunnel. For whatever reason my database refuses to connect with 'my_user'@'localhost' but will connect with 'my_user'@'127.0.0.1'.
My php code specifies the host as 127.0.0.1 but when I run the code I'm not allowed to connect and receive.
Access denied for user 'my_user'@'localhost' (using password: YES)
I am able to connect via the command line with
mysql -u my_user -p -P 3307 -h 127.0.0.1
however if I use
mysql -u my_user -p -P 3307 -h localhost
I receive the error above