Interestingly, after studying all the other solutions here, I realized that the problem is that the php5-mysql extension is not installed yet - it is not installed by default on new Ubuntu, nor when installing new php. So, for me, the solution was: install the php5-mysql extension:
sudo apt-get install php5-mysql
After that I did not get these nasty mysql_ * errors, -)
nemesisfixx
source share