I am desperately trying to connect to my sql database without luck. I either get "Error while trying to connect to the database server: SQLSTATE[HY000]  Connection refused" when i leave the database server as 127.0.0.1 or I get "Error while trying to connect to the database server: SQLSTATE[HY000]  No such file or directory" when i change the database server to local host. I am at a loss. I have no clue what else I can do.
Are you sure MySQL is installed and running? Do you know on which host it is listening?
May I suggest you install the very light yet powerful Adminer script. If this works, then it's a Piwik problem but if Adminer doesn't work then you have some error in your access.
Adminer is like phpMyAdmin but 300 kB instead of 22 MB... Way more secure too...
Was this issue every solved? I have the same error but insteading of using Adminer to test, I was able to connect to the database using MySQL Workbench. Is that an accurate test?