Pages

Monday, December 22, 2014

I Guess I'm Not Very Permissive

I spent the better part of the day trying to figure out why a PHP connection to a database wouldn't work while it worked yesterday. I got so frustrated that I uninstalled MySQL to reinstall it. As I did so, I realized I was wiping out the database I had created.

Sigh.

One of the things I've learned from this is that finding answers on the Internet is a real hit-or-miss affair. This problem, not being able to create a mysqli object in a PHP script, is a well-known problem. Lots of posts out there on the bulletin boards about it. The common theme is a link to the manual for the php.ini file which is supposed to explain just how to allow the connections, but doesn't.

Argh. File and access permissions and directory includes are the bane of my existence.

Update: I fixed the problem by reinstalling the php5-mysql package. Why did I have to do that? Where did it go? I shut down the server and restarted it in between yesterday and today. Why did that make it go away? Is it going to happen every time I do this?

Argh indeed.

Update 2: My old rainfall database was not destroyed! For some reason, uninstalling mysql didn't kill it. Hoorah! My command line rainfall harvester worked, too. I now have 2 days of data in my database! Now to set up a cron job to get it to run on daily basis!

No comments:

Post a Comment