CodeIgniter Forums
mysql_connect Error - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: Installation & Setup (https://forum.codeigniter.com/forumdisplay.php?fid=9)
+--- Thread: mysql_connect Error (/showthread.php?tid=62368)



mysql_connect Error - iamthestreets - 07-06-2015

Hi,

I have recently switched to a new hosting providor and cannot access my site online - production.

I have setup the credentials correctly but keep getting this error:
Code:
Message: mysql_connect() [function.mysql-connect]: Access denied for user 'username'@'xxxx.arvixe.com' (using password: YES)

My new host is Arvixe. They have been unable to help me resolve the issue and was hoping someone might have some insight on how to resolve my connection issue.

If I need to provide more info, let me know.


RE: mysql_connect Error - skunkbad - 07-06-2015

I think you should try to make a simple PHP script (non-CodeIgniter) and see if you can connect. It's highly unlikely that CodeIgniter is your problem.


Code:
$mysqli = new mysqli("localhost", "user", "password", "database");
if ($mysqli->connect_errno) {
    echo "Failed to connect to MySQL: (" . $mysqli->connect_errno . ") " . $mysqli->connect_error;
}
echo $mysqli->host_info . "\n";



RE: mysql_connect Error - iamthestreets - 07-06-2015

Thanks! I get the same error. I will continue to work with my host.


RE: mysql_connect Error - CroNiX - 07-06-2015

also, you should use mysqli driver, not the old mysql one. The mysql driver is deprecated from PHP and will be removed in a future version.