CodeIgniter Forums

Full Version: Database Connection Issue (after service restart)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]Mr Lazy[/eluser]
Hi,

I am using WAMP 2.0 and I have noticed something very strange (and only when using CodeIgniter). While I am developing my (MySQLi) database connection works fine, the details of which I have saved in database.php in the config directory. Works great, but after a while I get an error saying there is an error with my connection. Not even having database.php open, or having done anything with the database connection it is very confusing.

The things I tried to get my connection back:
1. Restarting the MySQL service.
2. Restarting the Apache service.
3. Swearing at my monitor.

The thing that fixed the problem:
1. Copying the password from my database.php file and pasting it (again) into the user account in MySQL Admin. Then clicking apply changes.

Does anyone know what might be going on here?

Thanks in advance,
Lazy

El Forum

[eluser]Mr Lazy[/eluser]
Hi,

I have never bumped a post of mine before, but this could be a deal breaker to whether I will use CodeIgniter. I have this issue locally, but when I demo stuff to the boss and I get the error:

Quote:A Database Error Occurred

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

when my settings actually have not changed, how do I answer the question "Will this happen in production?". Am I the only person to experience this? I hope someone can help me.

Cheers,
Lazy

El Forum

[eluser]xwero[/eluser]
It sounds like the rights of the user are being revoked by the the database server. I don't think this is a CI problem as CI has not yet the possibility to grant or revoke user rights.

El Forum

[eluser]Mr Lazy[/eluser]
Hi,

Mmm... I have recently hacked a small two page web app (not CodeIgniter) and used Fusebox (for PHP) for about eight months with the same localhost/WAMP/MySQLi set up. This is why I thought it may be a CI issue. I am really impressed with CI's simplicity and I want to use it. Maybe I could try creating my own database class and see if the problem remains....

Thanks,
Lazy

El Forum

[eluser]Mr Lazy[/eluser]
OK, I think I have worked out what is going on. xwero was completely right. I was dropping the schema, creating it again and plopping data back into it on a fairly regular basis. So the permissions on the schema were lost too. I hope all you CodeIgniter guys can forgive me...