WordPress on Red Hat / CentOS Linux

If you run WordPress on Red Hat Enterprise Linux (RHEL) or its free cousin CentOS then you will likely run into the following error after you have unpacked WordPress, installed it and tried to do your initial setup:

Error establishing a database connection

This either means that the username and password information in your wp-config.php file is incorrect or we can’t contact the database server at databasename. This could mean your host’s database server is down.

  • Are you sure you have the correct username and password?
  • Are you sure that you have typed the correct hostname?
  • Are you sure that the database server is running?

If you’re unsure what these terms mean you should probably contact your host. If you still need help you can always visit the WordPress Support Forums.

You are not alone, this happens to everyone.  If you do some searching on this you will find that pretty much no one has an answer for what is wrong.  People running MySQL server locally already know the trick necessary to fix this problem but if you are running MySQL remotely, as I am, then you can be easily mislead into thinking that the fix does not apply to you, but it does.

The issue here, surprisingly, is that SELinux is enabled on the web server and is keeping the MySQL library from communicating with the MySQL server whether local or remote.  Simply set SELinux to Permissive rather than Enforcing and voila, you should be working well.

The command to set SELinux to Permissive mode is:

setenforce 0

You can verify that the mode has changed correctly with:

getenforce

It is important to note that this SELinux issue (bug, I am told) does NOT affect the MySQL client but does affect PHP.  So if you are testing your database connection with “mysql” and it works but WordPress throws the error than you are a prime candidate for this problem.

Also, be sure that PHP has the MySQL module installed:

yum install php-mysql

I have seen this issue on several versions of all of the software components but specifically just dealt with it in CentOS 5.2 with PHP 5.1.6 and WordPress 2.7.1.

February 22, 2009: The Lagunas Come to Visit

The Miller family slept in a bit this morning.  We were quite tired after last night.

Liesl Meets Landen

We got up this morning and set about cleaning the house.  The floors are good and the furniture is all in place but there is plenty left to do, mostly in the kitchen.  Dominica got right up and red up the nursery taking down the air mattress which only Ramona really seems to use.  The house was looking pretty good by noon.

The Laguna family, Genaro, Dunia and Landen, came up to visit a little while after noon.  Oreo was very excited when he learned that they were coming.  As they pulled into the parking lot I asked Oreo “are Dunia and Genaro here?” and he got very excited and started running around the house.

After the Lagunas arrived, Oreo was so excited to see them that he had to run down to the basement and play with his rubber ball for a while.  He was very excited.  Dunia and Genaro run the daycare where Oreo used to attend.  He really misses them.  They were his other family for two years since even before we moved from North Brunswick, NJ to Newark, NJ.  He only stopped going there when we moved up to Peekskill.  So it has been a while since he has seen them and I am sure that he wonders where they have been.

You can check out pics that the Lagunas took of Landen, Liesl and Oreo on Landen’s blog.

Landen and Liesl are roughly the same age.  Landen is just over four months old.  He was born just when we moved up to Peekskill.  They have not had a chance to really meet until today.  Landen did send Liesl a Valentine’s day card – her first from a boy her own age.  Her very first Valentine’s Day card was from her great grandpa Tocco.

Most of the time, Landen and Liesl were not all that interested in each other but at a few points they realized that each other was there and were very interested in each other.  We managed to get some good pictures of the two of them together.  Hopefully I will get those posted to Flickr tomorrow or the day after.

We all visited until late afternoon.  Then, for dinner, we all went out to the New City Diner in Yorktown Heights for some dinner.

After dinner the Laguna family drove back home and we came back home and spent the evening working on the model railroad diorama while watching Murder She Wrote and Waiting for God.  The work on the diorama went really well tonight.  The diorama was just white plaster at the beginning of the evening and by the end of the night it was all but finished.  I can’t believe how quickly the work went.

Tonight’s work included painting the rock faces, tunnel entrance and all of the plaster.  It was a bit tough because the scenary kit had been sitting, apparently for years, in the sunny window of the train shop and all of the paint had long since dried and disappeared so I had to work with the dust that remained, but it worked out okay.  I would not have used what little I had had this been a real layout but since it was an educational diorama it seemed that getting the work done seemed to be a bit more important.

After the painting came the application of the ground cover.  That went pretty well.  It took a while to get all of the ground cover down.  After that came the creation of the trees.  I made Woodland Scenics trees that use plastic trunk forms combined with clump foliage that gets glued to the tree after I bend it to an appropriate shape.

Making the trees is definitely the most difficult portion of the diorama especially as the glue that you are supposed to use to make it work easily was ruined from having been in the store window for so long so I had to make due with a different type of glue.

February 21, 2009: More Carpet Cleaning

Liesl was up and very active a little before six this morning.  It was enough that it woke me up so I checked the alarmclock which Dominica had given me to use so that I could wake up in the morning and not knowing that she had it set almost twenty minutes fast I thought that it was a quarter after six.  So I decided that since I needed to be up at a quarter till seven that I might as well just get up and get ready to face the day anyway.  So my day started very early.

Liesl and Dominica got up around ten and came down to see me.  I vacuumed the living room carpet that was shampooed last night so that we would be ready to move all of the furniture again and clean the other side of the room.

My work for the office went for quite a long time today.  Not totally unexpected but it was more than I would have guessed.  I didn’t get a chance to wrap up completely until almost three in the afternoon which is pretty late when you consider that I started at seven in the morning.  That is a full eight hour day and I did not even take a lunch break long enough to eat with Dominica.  I shoved my tofu dogs down, took three phone calls then went back and quickly at my cold vegetables and returned to the office again.

An N Scale boxcar from Micro Trains arrived in the mail today.  It is my first boxcar of the Genesee and Wyoming Railroad.

The postman keeps putting these Priority Mail boxes into our mailbox that are too big.  They are just the perfect size to be inside the mailbox but they are larger than what can come through the front of the mailbox due to a flange that meets the front mailbox door.  Because he puts the mail in from the back of the mailbox unit he is unaware, I assume, that the front flange reduces the size of the front opening compared to the back opening.  So twice now I have had to cut open a USPS Priority Mail shipping box, remove its contents and smash it inside of the mailbox in order to retrieve it.  It is very strange that the USPS made a shipping box of such a precise size as to fit in the back of the standard USPS community PO Box and to not fit out of the front.  This much be a problem all over the country.

After I wrapped up work with the office I had a chance to begin the process of moving web sites over from Scranton to Toronto.  I managed to get all of the sites that I control and that do not use a database moved over almost immediately without any incident.  That went really well.  I am very excited to see how much faster the page load times are from Toronto than they were from Scranton and Scranton had been a nice improvement over Geneseo which had been an improvement over Washington, D.C.  It has been a process or steadily upgrading over the years.

At four we finally had an opportunity to really get busy with cleaning the livingroom carpet again.  Dominica and I moved all of the furniture while Liesl slept.  Then Dominica red up packing materials while I did the first round of vacuuming with the Kirby.  Then we did the spot cleaning with some soap and a brush to tackle the worst of the stains.  Then the real shampooing.

The shampooing went much more smoothly today.  Yesterday was our day to learn how the shampoo attachment for the Kirby works.  After doing two rounds of shampoo last night we are pretty good at it now.  Doing the work today was a breeze.

The shampooing and basic cleanup was completed by five thirty.  Not too bad considering what a large space we had to do.  The tough part is, of course, once the shampooing is done the entire north half of the living area – that portion where the dining room table goes, is now wet and we can neither use it nor can we move our furniture back into that space.  So now we are stuck with a wet room on one side and a room crammed full of our furniture on the other with Oreo hiding on his pillow as far from us as he can get.

Dominica and Liesl went down to the basement and spent a few hours just hanging out down there on the sofa that we have there as it was really the only available space in the house where they could sit and be dry.  Oreo went down and sat on the sofa as well.  I received a few phone calls and was on the phone for a while and so went upstairs and paced around the large, open space that we temporarily have available in the dining room area.  The pacing in my socks helped to squeeze out the excess moisture and helped to dry the carpeting more quickly.  While I was on the phone I hooked up a fan to blow air across the floor which helped a little.

Once my phone calls were done and Liesl was falling asleep I took a trip into the attic and we loaded it up with all of the stuff that we have been waiting to store up there.  That took half an hour or more but cleared up a lot of space from all over the house.  Hard to believe how much stuff we had waiting to go up there.  Only a small amount of it came from dad’s last delivery of stuff for the house.

The carpet actually dried faster than we had thought that it would so by late in the evening we were able to begin actually putting the furniture back where it was going to go.  We had decided a few days ago that the rooms were really set up with a very different use in mind that what we actually ended up using the rooms for.  Originally we had put the furniture where it was when Liesl had not yet been born, when we had no video game systems but the Wii which we never used and we had only a small television near the fireplace that we were not even sure was going to stay in the living room area.

Now we have come to learn that Dominica and Liesl really spend their time in the living room and that it is the hub of all of the household activity.  We really needed to rethink the way that the furniture was situated based on the fact that the big television over the fireplace is always on and something is always going on on it, that there is always a laptop in use in the living room and that Liesl will always be hanging out in the living room and that she will need a permanent changing station there.  We also admitted that the dining room table was not really used for eating dinner and that it should not be set up in the way of other things in the hopes of eating dinner either.

The dining room table is now much farther into the corner so that we can still use it but it takes up much less space than it did before.  The lamp still needs to be adjusted.  The worktable where we have been doing the model railroading goes along the wall by the dining room table and can be moved to the back of the love seat like a console table so that I can sit in the dining room and work while facing the television and see over the love seat.

The recliner now faces the television almost directly head on rather than at an awkward angle so that when it is used for feeding Liesl that you can actually see the television rather than cranking your head far around to the side.  The two individual chairs have been moved along the western wall near to the deck door and are mostly just used for when we have company visiting us and for seating at the “changing station”.

We are very happy with how the room reorganized.  Now the living room and dining room are not separated by the wall of the large recliner and it feels much more like a large, open space.  It makes it far easier for us to hang out as a family and to use the four things that we actually use in that room – the television, the laptop, the modeling table and the changing station.  Originally it was laid out as a sitting room and formal dining space which are two uses for which the area is never used.

February 20, 2009: Carpet Shampooing Day

Liesl got Dominica up early this morning around seven but fell back asleep a little after seven thirty.  So, as we had run out of baby formula last night and it will be a pretty serious emergency if we do not have any today, Dominica ran to Stop & Shop at a quarter till eight this morning and left me to look after Liesl and Oreo while she was gone.  Liesl actually stayed almost completely asleep the whole time.  Oreo got up pretty much immediately as he hates being in bed after anyone has gotten up.

Last night I topped 2,000 Tweets on Twitter.  That is a lot of microblogging.  Originally I didn’t think that Twitter and microblogging in general would be all that interesting but I have found it to be quite cool.

Through Twitter I have come across the new blog, Trains and Bricks, which is written by Linda Smith and is chronicling her adventures in starting in the model railroading hobby.  Linda, like Dominica and I, is into N Scale model railroads (they are the coolest, as you know.)  Linda received a Kato starter set on Valentine’s Day from her husband and seems quite excited.  She must as she has a blog about it.  Linda is also very much into Legos!  It is neat to have Linda getting into N Scale model railroading at almost exactly the same time that Dominica and I are getting into the hobby as well.

The hobby is not new for me and not quite new for Dominica but, as of yet, Dominica has never had a running train but has done a bit of actual modeling that is extremely advanced for a beginner (foam benchwork, plaster-cloth on newspaper terrain, ballasted flextrack on cork, weathered buildings, etc.)

The weather turned very cold today and there is a solid dusting of snow on the ground that is determined to not be going anywhere.  Oreo took only the shortest of walks today to minimize the time spent outside.

I was not really all that busy today at the office, not for a Friday, but somehow I ended up being quite busy around lunch time and missed taking a break for lunch at all.

The new server got hooked up early this afternoon in Toronto, Ontario, Canada.  We are all extremely excited about this.  We have had so many problems with the network stability and power stability of the datacenter in Scranton that we are really looking forward to seeing what we get out of Toronto.  I am saving a bit of money by going this way as well.

There was a little bit of configuration work that needed to be done to get the email system actually online and working but it took very little and things started working like a charm almost immediately.  Many of the issues that we had seen earlier this week were, as we had guessed, caused by the temporary hosting on a consumer network and vanished as soon as we were on the commercial backbone network.

Dominica did get a chance to do another segment of her class today.  This second course in her four course series has several fewer objectives or segments than the last one did (this one has ten compared to nineteen, I believe) but each one is much more involved and difficult so instead of doing two or three at a time she is pushing had to be able to finish one in the tiny amount of time that she is able to get without Liesl causing too much of an interruption.  Any progress is good progress though.

Not long after lunch Liesl actually fell asleep and Dominica, being exhausted from yesterday, fell asleep as well in the recliner in the living room.  They both managed to get really good, several hour long naps in and did not get up until around seven in the evening when I was wrapping up my work for the office.

For dinner Dominica cooked a “Mama Mia Casserole” which is a baked spaghetti dish.  We watched some Murder She Wrote during which I had to make constant trips to the basement to check in on the office.  I had some amount of work that continued until about half past midnight.  Nothing major but I had to stay in contact.  No rest on a Friday night for me.

I decided tonight, because they were both sitting in just the right place to make this easy, to pop in the two dead DVDs that we have just to be absolutely sure that they were unusable.  The one DVD, which we bought many years ago used from Hollywood Video, was Magnolia. The DVD never once played, to any degree, in any device that we owned.  We’ve kept it more out of principle than anything else.  We bought it so we figured that we should keep it.  So tonight, when I popped it into the HP external DVD drive that I have on my Windows workstation and it read the entire disc without an error I was completely taken by surprise.  We now have a three hour long movie that we did not have yesterday.  Very cool.

I then took the Build Design Dream DVD that Model Railroader sent to us in the mail as an advertisement – that showed up as being blank on every DVD player that I put it into – into the DVD drive on Dominica’s laptop and it too was able to be read without a single error.  It’s completely crazy.

So now we have two more things to watch that we already owned without spending a dime.  Nice.

We did get some time to relax until Liesl dropped off and was happily asleep around ten or so.  Then the real work began – shampooing the living room carpet.  We moved all of the furniture from the south side of the living room (by the deck doors) to the dining room area so that we had roughly half of the room completely clear.

I did a hard-core vacuuming job with the new Kirby and got all of the loose stuff up and off of the carpet.  This will be our first time doing a full shampoo.  We (I) bought the Kirby because of its shampoo capacity but it is such an undertaking, especially with a baby and a dog, to relocate all of the furniture and to have the carpets be wet that we have not done it yet.

It took two full loads of Kirby shampoo liquid to do that portion of the living room.  It took us a while to figure out how to do the shampooing since it was our first time.  We had to spend some time with the manual and only I ever saw someone use it in this way before so it was all new to us.

Overall, I think, the shampooing went pretty smoothly.  It was a little bit of a learning curve but not too bad.  It was almost one in the morning when we wrapped up.

Tomorrow I start work at seven in the morning (less than six hours from when I managed to go to bed) so I am going to be a bit tired.  I have deployments starting and seven and disaster recovery testing starting at eight.

I also need to get up tomorrow and vacuum the carpet that we shampooed tonight after it is completely dry.  Then, once that is done, all of the furniture that is in the dining room area has to be squeezed into the living room area on the south side so that we can shampoo that portion of the carpeting.  Most of that section was not touched during the Kirby demonstration and is still loaded with stains from the previous owners of the house.

February 19, 2009: Email Server Arrives in Canada

The cold weather has returned to downstate New York.  No doubt about that.  This morning wasn’t quite that bad but it was not warm by any stretch.

I got a chance to take Oreo on a nice, long walk today.  There was a break in the weather when the wind was still and the rain stopped and the snow had not started yet when we were able to sneak out and do some walking.  So we walked all the way up the hill to the top of Chapel Hill then down, almost to the main entrance where we took the Nature Trail that we have here in the complex through the Hillside and then down to the back exit and back to the house from the other side.  Oreo had such a good time.  It is the longest walk that we have taken together here, I think, and we covered a bit of territory where I do not believe that he has ever been before.  He was a very happy dog all day after that.  It did not hurt me any to get that extra exercise in either.

We have been doing Weight Watchers here and I am happy to report that I am currently down twenty-five pounds!  I am feeling much better too.  The Weight Watchers diet is not too hard to do and is pretty easy to stick to even after doing it for a while.  The combination of the program and the Nintendo Wii to keep track of my progress really works well for me.

My new Genesee and Wyoming Alco RS-1 N Scale locomotive from Atlas arrived today.  It is part of their less expensive “classic” series which cannot be updated to work with DCC (Digital Command Control or Digital Cab Control) but it is built just as well as their normal line and this particular model really looks great.

I managed to finally get a group of Liesl pictures posted on the Flickr site today.  I have more that should be coming tomorrow as well.  The ones that went up today came from my Nikon D50 SLR and the next batch will be pictures that Dominica took with her Kodak digicam.  I think that I might have some more on my Kodak digicam as well.

The new server arrived in Toronto, Ontario today.  They did not get a chance to rack it and test it out but at least it was signed for and they confirmed over the phone that it had arrived and that they would get to it in the morning.  It would be nice to have it tonight, but it is not like I don’t have plenty of other projects to be working on anyway.

There was no opportunity to do any model railroading at all tonight.  Liesl did not nap a wink all day long today.  That made the day really tough.  She spent most of the evening fussing and complaining.  We really were not able to get anything done.  The most that we were able to do was to spend an hour or more working really hard to keep her entertained so that Dominica would be able to complete one of the chapters / sections in her online course from the O’Reilly School.  This particular piece was a challenging one and it was very difficult for her to get through it with Liesl complaining the whole time.  Very distracting.

We spent the evening sort of watching Murder She Wrote.  We really did not get to watch very much.  We had it on pause most of the evening because we could not hear it over Liesl.

We found out today that I did not get a week’s pay this month.  One of the four weeks for this month apparently got missed no my payroll so we are short twenty-five percent of our income for the month.  February is the shortest month so it is naturally the worst month to have less opportunity to make any money and this month we also got hit with that $1,400 tax mistake from the bank that caused us to have to produce all of that cash without any warning and we also paid, up front, for all of Dominica’s classes so, altogether, we had about $3,000 of surprise expenses this month and lost a quarter of our income for the month.  Paying the bills next week is going to be really painful.  I spoke to work and they were unable to figure out what happened to my pay so, for the moment, we just have to wonder what will happen.  I do know that with their payment process there is no way for them to get me another check until March at the earliest.

Tomorrow our project is to move all of the furniture out of the one half of the living room so that we can shampoo that half of the room in the hopes that sometime on Saturday we can do the same thing to the other half of the room.

Saturday is going to be incredibly busy for me.  I have to be up early, as I often do, to do deployments first thing in the morning.  Then I have my system patching that I do most Saturdays.  Then we have a continuity of business (a.k.a. disaster recovery) test on Saturday afternoon that I am covering for several people because test was scheduled at the same time as a site shutdown for the site where most everyone with whom I work works.  So my day will be crazy.  Then on Sunday we have house guests.  We hope to be able to get the house cleaned, to some degree, before they arrive.  I doubt that we will get anywhere near as much done as we want to get done.

Today Dominica set up our “old” coffee maker – the awesome one that we got as a wedding present in 2003 (it seems new to me but I guess that it is over five years old now) that grinds and brews and filters all in one step.  It’s great.  It makes the best coffee ever.  It got packed away in 2007 when we moved out of the house in Geneseo and we have been using the Keurig one cup at a time machine ever since.  Dad recently brought the good coffee maker to our house in the latest load that he delivered and now we can start using it again.  I prefer the high quality coffee that it brews, but Dominica prefers the one cup flavored coffee that she can do with the Keurig K-cups.

We made it to bed around midnight tonight.  Hopefully tomorrow we will have good news about the email.  I am told that we should expect the new machine to be online and running before lunch.