Your DSN shows that you are trying to use the Mysql driver and the error indicates that the driver is unavailable.
Make sure the extension is installed.
On Ubuntu/Debian you can do the following to check if it is installed
dpkg --get-selections | grep php5-mysql
If not, you can install it like this
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 the bind-address
for 0.0.0.0
to listen to connections from any IP.
bind-address = 0.0.0.0
Give connection permission to all Ips
mysql -u root -p
At Mysql prompt type
use mysql
// Caso o root não possua senha use
GRANT ALL PRIVILEGES ON *.* TO root@'%'
// Se tiver senha use
GRANT ALL ON *.* to root@'%' IDENTIFIED BY 'senha';
FLUSH PRIVILEGES;
exit
Restart Mysql
sudo /etc/init.d/mysql restart
Can post mysql error message?
– rray
Displays this message "cdbconnection failed to open the db Connection" I use the Yii framework
– Bruno Santos