Q:

Symfony Firewall can't access mysql database

Im getting the following error on the login_check action:
[2012-09-25 11:51:19] event.DEBUG: Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\ProfilerListener::onKernelRequest". [] [] 
[2012-09-25 11:51:19] event.DEBUG: Notified event "kernel.request" to listener "Symfony\Bundle\FrameworkBundle\EventListener\RouterListener::onEarlyKernelRequest". [] [] 
[2012-09-25 11:51:19] event.DEBUG: Notified event "kernel.request" to listener "Symfony\Bundle\FrameworkBundle\EventListener\SessionListener::onKernelRequest". [] [] 
[2012-09-25 11:51:19] event.DEBUG: Notified event "kernel.request" to listener "Symfony\Component\Security\Http\Firewall::onKernelRequest". [] [] 
[2012-09-25 11:51:19] security.INFO: Authentication request failed: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/tmp/mysql.sock' (13) [] [] 
[2012-09-25 11:51:19] security.DEBUG: Redirecting to /user/login [] [] 
[2012-09-25 11:51:19] event.DEBUG: Listener "Symfony\Component\Security\Http\Firewall::onKernelRequest" stopped propagation of the event "kernel.request". [] []

Which is weird because i already have created the symlink between /tmp/mysql.sock and /run/mysqld/mysqld.sock and i am able to create the database,schema, load fixtures, etc...
What is going on? Thanks

A:

As usual, stackoverflow seems to be a source of inspiration and i managed to solve the issue. I needed to create the symlink as root and not as a user. So doing
sudo rm /tmp/mysql.sock
sudo ln -s /run/mysqld/mysqld.sock /tmp/mysql.sock

Did the trick.
As a side note: ¿How was i able to create a symlink on /tmp without super user? 
¿Shouldnt it had prevented me from doing it?

