I think it is pretty explanatory, you are not using the right credentials. Are you sure root with an empty password is going to log you in? Have you tried using localhost instead of getenv('IP')?
The error basically tells you the credentials are wrong. So try some others.
Have you changed the port number? Why does your PHPMyAdmin register that it’s connected to 3308? The default should be 3306.
Have you got multiple instances of MariaDB/MySQL running?
If your host is running on the default port, obviously you’ll have to change the port back. If you leave the port variable empty (like you did for the original line), PHP will assume 3306 as a default.