Codeigniter: Unable to connect to your database server using the provided settings
As default a MySQL Server is configured that he allowes only a binding from localhost.
Go to your my.cnf and comment the line
bind 127.0.0.1
Then you should look that your MySQL user has enough rights to access from other ips.