Welcome Guest, Not a member yet? Register   Sign In
Database Error of CI on my online server HELP!!!!!
#1

[eluser]Xeroxeen[/eluser]
Hi,

I previously also posted this issue here.But someone told my username and password of the database can be incorrect.So i checked carfully it.Those are correct.But when i’m trying to access the site it’s showing,

Code:
A Database Error Occurred

Unable to connect to your database server using the provided settings.

Filename: core/Loader.php

Line Number: 346

After that now i'm getting this error

Code:
Unable to locate the model you have specified: testmodel

Then i searched all over the internet for a solution.I saw many people have got this issue.But most of them were due to the wrong MySQL credentials in config file.But i’m 100% sure those are correct.Then i saw someone has told to change the debug attribute to FALSE.I did that too.And then chnage mysql to mysqli.It’s also not working.I gave the all privileges to the database user too.So i’m stuck at this point.Please help me CI experts…..
#2

[eluser]noideawhattotypehere[/eluser]
Is your DB on the same server as your site?
#3

[eluser]Xeroxeen[/eluser]
[quote author="noideawhattotypehere" date="1377852768"]Is your DB on the same server as your site?[/quote]

yeah.therefore i put the "localhost" as the database host
#4

[eluser]noideawhattotypehere[/eluser]
check your /etc/mysql/my.cnf, see bind-address, maybe somehow it got changed to listen to some other ip?

run this and see if that works, so we know its 100% codeigniters fault:
Code:
<?php
$link = mysql_connect('localhost', 'mysql_user', 'mysql_password');
if (!$link) {
    die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
mysql_close($link);
?>
#5

[eluser]Xeroxeen[/eluser]
[quote author="noideawhattotypehere" date="1377857228"]check your /etc/mysql/my.cnf, see bind-address, maybe somehow it got changed to listen to some other ip?

run this and see if that works, so we know its 100% codeigniters fault:
Code:
<?php
$link = mysql_connect('localhost', 'mysql_user', 'mysql_password');
if (!$link) {
    die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
mysql_close($link);
?>
[/quote]

ok.i'll check that
#6

[eluser]Xeroxeen[/eluser]
[quote author="noideawhattotypehere" date="1377857228"]check your /etc/mysql/my.cnf, see bind-address, maybe somehow it got changed to listen to some other ip?

run this and see if that works, so we know its 100% codeigniters fault:
Code:
<?php
$link = mysql_connect('localhost', 'mysql_user', 'mysql_password');
if (!$link) {
    die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
mysql_close($link);
?>
[/quote]

Hi run this code.It's showing 'Connected successfully'.So that means there isn't issue in server?What can i do now?
#7

[eluser]Xeroxeen[/eluser]
Finally could solve the issue by myself.Issue was i have put some uppercase letters for the model files names.When i check the Codeigniter userguide could find it should in lowercase.But in localhost xampp it worked properly.Sometimes in a complete linux environment in the server can be an issue for that.Anyway finally could solve the issue.




Theme © iAndrew 2016 - Forum software by © MyBB