Welcome Guest, Not a member yet? Register   Sign In
Strange database problem
#1

[eluser]Tomas Sundvall[/eluser]
Hello!

I have recently re-bulilt a website with codeigniter, and it worked perfectly. But when I uploaded the website to the webhost, i got som strange problems.

At first everything worked good. But when I started to move around the page, I sometimes got this error message:

An Error Was Encountered
Unable to connect to your database server using the provided settings.

When I reload the page, it work's again. Every function on the page works, but sometimes this error message just show up. I just can't figure out what the problem is.

Does anyone have an idea of what's going on? When I run the page localy, this problem dosen't occur.

/Tomas
#2

[eluser]gtech[/eluser]
sounds like the db connection is dropping out, have you tried changing the pconnect variable in the database config?
#3

[eluser]TheFuzzy0ne[/eluser]
Are you able to login to the MySQL database through the command line, or does your host not allow SSH access?
#4

[eluser]Tomas Sundvall[/eluser]
Research Assistant: Yes it does, when I checked in my db config file it seemed like pconnect was enabled by default ( $db['default']['pconnect'] = TRUE );

This is so strange, and it also seems like it drop out totaly random, at first a page loads perfectly, but when i push f5 or reclick the link to the page, the database drops out sometimes. I can't see any pattern.

Lab Assistant: I'm not allowed to use SSH, but ther's no problem connecting to the database throu phpmyadmin, or my webpage(most of the time). But suddenly and totaly randomly, codeigniter is not able to connect to the database anymore.


I'm sorry, my english is not that good, but I hope you understand what I'm writing : ).

/Tomas
#5

[eluser]James Gifford[/eluser]
Have you tired using the debug setting (in the database config file) and/or logs to get more information about the error?

If not, try turning debug on and then setup a connection test which outputs the error. That might shed some more light on the problem.
#6

[eluser]gtech[/eluser]
good idea james,

also try setting pconnect to FALSE as some people have said this is unreliable on a shared server

[url="http://ellislab.com/forums/viewthread/74050/"]http://ellislab.com/forums/viewthread/74050/[/url]

let us know how you get on.
#7

[eluser]Tomas Sundvall[/eluser]
Thanks for the help!

It seems like pconnect was the problem. I now tried to change it to FALSE, and sincen then I haven't recived any errors.

Thanks!

/Tomas
#8

[eluser]gtech[/eluser]
glad to help, I must admit I am unsure why it happens though
#9

[eluser]Tomas Sundvall[/eluser]
Yes, my only conclusion is that the problem occured because of server configuration differences. But I'm really glad that the problem is solved now atleast! Smile




Theme © iAndrew 2016 - Forum software by © MyBB