Your DSN shows that you are trying to use the MySQL driver and the error indicates that the driver is unavailable.
Verify that the extension is installed.
In Ubuntu / Debian you can do the following to verify that it is installed
dpkg --get-selections | grep php5-mysql
If it is not, you can install it as well
sudo apt-get install php5-mysql
Then restart apache for the new settings to take effect.
sudo /etc/init.d/apache2 restart
If already installed check which host MySQL is accepting connections to. Run
sudo nano /etc/mysql/my.cnf
Change bind-address
to 0.0.0.0
to listen for connections from any IP.
bind-address = 0.0.0.0
Give connection permission for all IPs
mysql -u root -p
At the MySQL prompt type
use mysql
// Caso o root não possua senha use
GRANT ALL PRIVILEGES ON *.* TO [email protected]'%'
// Se tiver senha use
GRANT ALL ON *.* to [email protected]'%' IDENTIFIED BY 'senha';
FLUSH PRIVILEGES;
exit
Restart MySQL
sudo /etc/init.d/mysql restart