Posts Tagged ‘MySQL’

Blog Comments and Discussions Disabled

October 12th, 2021

Since the blog began back in 2008, there have been many relevant and valuable comments left on blog articles here. Over time, I have implemented various plug-ins, security measures, as well as backup and recovery mechanisms to combat the growing amount of comment spam and hacking attempts on this blog.

Akismet Anti-Spam (a plug-in I have been using) recently announced that their free to use plug-in is moving towards a payware model. This change took effect in mid-August and my free use account was disabled. Fast forward to today and I found that I had nearly 700,000 comments (probably all spam – I only looked at the first 100) waiting to be approved. While these unmoderated comments didn’t make their way to polluting the blog, attempts to delete them did cause problems with the the blog and MySQL database resources on the server.

The good news is that after some unplanned time spent, I got it all cleaned up and the blog appears to be healthy and functional.

The bad news is that, for now, I’m waiving the white flag on combating spam. Until further notice, blog comments and discussions will effectively be disabled for pages as well as blog posts older than 14 days. If I find that is not effective enough, I will disable comments and discussions across the board. For any feedback, discussion, questions, etc. on any blog post, please reach out to me via Twitter or Email.

Thank you,


Blog backup?

October 31st, 2008

Just in time for Halloween, a Scary WordPress Moments! blog article has been published.

I back up my WordPress database (MySQL) daily using a Windows scheduled task.   A script (built by the MySQL Administrator) is executed which dumps the database to a file (hot backup).  The database dump is then backed up to tape nightly.  I believe the backup method is solid and I’m also thinking ease of restoring (the whole database) is easy.  Restoring individual tables or rows however – probably a nightmare I don’t want to get involved with.

There exists another backup method in plugin form located here.  Since I host my own blog, I don’t really have a need for the “Save to server” versus “Save to my computer” options.  I certainly don’t need to email the backup to myself.  I’ve already instituted a backup method that should have me covered.  It’s automated with script and scheduling so to me that’s a huge benefit.  Work smarter, not harder right?

I’m new to both blogging and WordPress.  Is my backup methodology sound?  One thing that I think I share in common with all bloggers:  I would hate to lose what I have created.  One of these weeks I should test the restore scenario in the lab to make sure it works.

My First Blog and How To Install WordPress

October 18th, 2008

Well how special am I?  I had two paragraphs of my first blog post written and after changing to full screen mode, I lost everything I had typed!  And I was just about to comment how impressed I am with WordPress.  I still am but I just learned my first valuable lesson with this web based application.  I am actually blown away by the flexibility and number of versatile configuration screens the admin console has.  I am proof that with WordPress, anyone can have a professional looking blog, irregardless of content.  Now I just need to find a decent theme so my blog isn’t mistaken for RTFM Education.

So actually this isn’t quite my first ever blog post.  My first blog post was written several months ago on a different platform when I had five minutes to kill.  I also write family news once in a while on my site to keep our relatives up to date on current events around our house.

Before installing WordPress, I had a few thoughts on what my first blog post should be.  Helpful and insightful to the reader.  As I struggled for a few hours getting WordPress to work, I knew I had a topic in the making:  How To Install WordPress.  Well, not so much how to install and configure WordPress, but rather how to install and configure the prerequisite platform components so that WordPress works correctly.  Hopefully someone is able to follow the steps I did without wasting hours troubleshooting PHP, IIS, and directory permissions.  By the way, this is on Windows Server 2003.  The error message I was struggling when trying to use WordPress was “Your PHP installation appears to be missing the MySQL extension which is required by WordPress”.  Here are the steps I followed to get WordPress up and running successfully:

  1. You need a web server.  Install Windows Server 2003 and Internet Information Services 6 (IIS).  Windows Server 2008 and IIS 7 may work also, but that platform introduces some significant differences which I don’t have the tested steps for.  Create your new website in IIS Manager, or use the default website.
  2. Install MySQL 5.0.67.  I used the MSI installer (file name is mysql-essential-5.0.67-win32.msi).  Don’t use the .zip file.  Choose an installation drive letter that’s going to provide enough disk space for your WordPress database and any other MySQL databases you might want down the road.
  3. Create your WordPress database by using the MySQL Command Line Client from the Start Menu.  The command is CREATE DATABASE wordpress;   Don’t forget the trailing semi-colon.
  4. Install the MySQL Administrator which you can download from the MySQL website.  File name is mysql-gui-tools-5.0-r13-win32.msi.  Use MySQL Administrator to create a WordPress user account that will be used by WordPress to manage the WordPress database in MySQL.  When creating the user account, grant all MySQL roles for the user on the WordPress database.
  5. Install PHP 5.2.6 using the MSI installer (not the .zip file).  File name is php-5.2.6-win32-installer.msi.�
    1. Perform a custom install. 
    2. Web Server Setup:  IIS ISAPI module
    3. Important:  Choose two extensions to install:  MySQL and MySQLi
  6. The installer will perform several key configurations for you:
    1. Adds your PHP installation directory to your PATH statement allowing your server to find the file libmysql.dll
    2. Places the two extension .DLLs in the \ext\ directory which PHP based WordPress needs
    3. Modifies the php.ini file to activate the two extension .DLLs
    4. Creates a PHP Web Service Extension in IIS and sets to Allow
    5. Adds the .PHP application extension and appropriate verbs to IIS
    6. Creates the environment variable PHPRC=(path to your PHP directory)
  7. Next step, set the correct NTFS permissions on your PHP directory.  Allow subfolders and files to inherit.
    1. Internet Guest Account (IUSR_servername) = Read & Execute
    2. NETWORK SERVICE = Read & Execute
  8. Install WordPress 2.6.2 by unzipping the folder contents into the appropriate IIS directory structure for the website defined in step 1 above.
  9. Set the correct NTFS permissions on your WordPress installation directory.  Allow subfolders and files to inherit.
    1. Internet Guest Account (IUSR_servername) = Modify
    2. NETWORK SERVICE = Modify
  10. In IIS Manager, modify the properties of your website.  Documents tab.  Enable default content page:  Add:  index.php
  11. Restart the World Wide Web Publishing service
  12. You’re ready to install and configure WordPress.  Follow the instructions at

Using the PHP MSI installer with the appropriate options is the best use of your time.  Many Google internet searches on the error message above will have you performing steps that may or may not resolve your issues if you choose to install PHP manually.  None of the home brew solutions worked for me and resulted in a waste of time:

  1. Modifying the php.ini, changing the path for extension_dir=
  2. Modifying the php.ini, tweaking values for extension=
  3. Copying the file libmysql.dll to %systemroot%\system32\
  4. Adding and modifying environment variables
  5. Rebooting your web server

Special thanks to Michael Sharman and his website who ultimately pointed me in the direction of re-looking at the PHP MSI installer where I had missed the steps of adding the two MySQL extensions.

By the way, after struggling for a while on my production web server and not wanting to muck it up while spinning my wheels, I called on the assistance of a vanilla VMware virtual machine running Windows Server 2003 to successfully test my new installation steps (taking snapshots along the way).  VMware virtualization helps save the day (again).