• SQL

    The SQL SELECT Statement

    Most tasks you will execute against a database are done with SQL statements. Think of statements as a query, an insert, a change, or a delete operating. For example, to see all of your data, you would select all of the records from a database using the SELECT statement. Then we’ll ask for all, or *, and tell the command to show us where the data is coming from, which is the Customers table. Finally, we’ll be nice and tidy and put a semi-colon at the end; although if you forget, you can always do so after you hit return: SELECT * FROM Customers; As can be seen above, the…

  • Mac OS X,  Ubuntu,  Unix,  WordPress

    Resolve InnoDB Errors In MySQL

    Database won’t start? InnoDB errors are a pain. Where was krypted for a month? Did everything finally get to me and I gave up blogging? No, the site ended up having some problems with corruption in some rows of the InnoDB tables. But, I was able to get the site back up by putting the database into recovery mode. How did I do this? It’s pretty straight forward. Open my.cnf and paste these lines in there: innodb_force_recovery=3 innodb_purge_threads=0 Once the corruption is resolved, bring up empty databases and import your mysqldump into the new databases and link your site back up. But, the InnoDB force recovery puts the database into…

  • Mac OS X,  Network Infrastructure,  Ubuntu,  Unix

    When Packets Are Too Large in MySQL

    Every now and then you’ll see an error like “Packet Too Large” in MySQL, as seen below. When you run into this, you’re trying to shove more information into a given SQL statement than is allowed. So to fix, you have a few different options, starting with the best, which is to make your SQL better. But not everyone has control of things like source code. So you might need to change the value in mysql itself. To do so, simply run the mysql command with the –max_allowed_packet and then put = followed by the size of the packet. For example, to make it 128: mysql --max_allowed_packet=128M Now, by default…

  • Unix,  WordPress

    Resetting a WordPress Password

    Sometimes you can bite yourself a little when you experiment around with things. I installed a security plug-in and the next thing you know I couldn’t log into my own website. Ouch. Not a huge deal as it actually led to experimentation with the MySQL tables for WordPress, which oddly enough, I’ve typically just left well enough alone. But this I figured was gonna’ need to be updated eventually (although I relished the opportunity to get caught up on some stuff in the meantime). So first up, SSH into your box. Then fire up mysql: mysql -u root -p Turns out there’s a wp_users table in there. For my user…

  • Business

    Iron Wars

    Occasionally I say that everything I need to know I learned from the game Civilization (partially in jest). In Civilization, you need to amass a certain amount of resources in order to build things in your various cities (and generate armies). Iron is something you can use to build a number of things. There are other resources you need to be concerned about, of course… In modern times, in order to be able to sell iron, you need a compelling reason for people to buy it – and corporate wars ensue to end competition to this end. One really great reason is the best threading model on the market; another…

  • sites,  WordPress

    Upgrading WordPress to 2.7

    Well, it’s that time of the year that I need to do a little spring cleaning of the ‘ole site.  So I figured I’d post how to upgrade WordPress.  It’s pretty straight forward.  But before getting started back up your install.  This includes the files and the database.  First off, the files.  For that just back up the root of your Apache home directory.  If you’re on a shared host this is often the public_html or www folder.  If you’re on a Mac Server this might be /Library/WebServer/Documents.  If you’ve customized your css and themes, etc you will most certainly want to triple-check that you’ve gotten your wp-content folder. Once…

  • Mac OS X Server

    Mac OS X Server: GUI Security for MySQL

    Prior to Mac OS X 10.5 MySQL was administered in a stand-alone application.  In 10.5, MySQL has been moved into Server Admin.  Many of the security-centric aspects of MySQL should be managed in the my.cnf file or using MySQL tools.  However, you can disable network connections using Server Admin unless the database actually needs to be accessed from hosts other than the server. Additionally, many administrators who lack the time to turn MySQL into a bastille of security choose to implement PHPMyAdmin with Mac OS X Server to easily update settings they might not be so quick to find in the command line.  

  • Unix

    Making the case for Solaris

    I recently read an article that Solaris is a dead OS (or will be rather shortly).  I beg to differ, proveded the hardware support is there.  Solaris can still multithread better than anyone.  Solaris’ ZFS is still the most superior file system available (although before the ReiserFS founder got put in prison for wasting his wife it looked poised for greatness) and the Sun hardware is still best of breed.  Sun as a company is also going to be building tighter integration into MySQL, which should help boost numbers.   But the pony-tail-laden chief of Sun definitely has his work cut out for him.  There are certain acquisitions that have…

  • SQL,  Unix

    Viral Marketing

    Is it possible that a client can build a Facebook app, deploy it and not tell anyone, yet get so much traffic on the app that we have to add a second server within 6 hours?  Yes.  Is it then possible to quickly prop up an Apache cluster, forklift the data in there, throw together a quick MySQL cluster and be off to the races within 4 more hours while the end users of the app are complaining?  Yes.  Why, because there’s money in it.  And where there’s money there’s will.  And where there’s will there’s a way!