Have you tried MySQLTuner yet? It's free and it makes optimizing your MySQL server easier than ever!

I’ve received some great feedback on my first screencast. The suggestions have been helpful, and the compliments have made me want to create more free screencasts.

At this point, I’m opening it up to you - what would you like to learn? Of course, I’m still planning to make a full set of screencasts for the MySQL DBA certification, but that will come later.

Comments 3 Comments »

MySQL has quite a few cryptic error messages, and this one is one of the best:

mysql> DROP USER 'forums'@'db1.myserver.com';
ERROR 1268 (HY000): Can't drop one or more of the requested users

Naturally, I was quite interested to know why MySQL wasn’t going to allow me to remove this user. There was nothing special about the user, but then again, this wasn’t a server that I personally managed, so I wasn’t sure what kind of configuration was in place.

It’s always a good idea to get your bearings, so I checked the current grants:

mysql> SHOW GRANTS FOR 'forums'@'db1.myserver.com';
+----------------------------------------------------------------------+
| Grants for forums@db1.myserver.com                                   |
+----------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'forums'@'db1.myserver.com' WITH GRANT OPTION  |
+----------------------------------------------------------------------+
1 row in set (0.00 sec)

The GRANT OPTION was causing my grief. It was the only privilege that the user had on the server. I revoked the privilege and attempted to drop the user yet again:

mysql> REVOKE GRANT OPTION ON *.* FROM 'forums'@'db1.myserver.com';
Query OK, 0 rows affected (0.00 sec)

mysql> DROP USER 'forums'@'db1.myserver.com';
Query OK, 0 rows affected (0.00 sec)

It’s key to remember that revoking the GRANT OPTION is a completely separate process. Revoking ALL PRIVILEGES doesn’t include GRANT OPTION, so be sure to specify it separately:

mysql> REVOKE ALL PRIVILEGES, GRANT OPTION ON *.* FROM 'user'@'host';

Comments No Comments »

I received an e-mail from Tim Linden about a post he made in his blog about backing up MySQL data to Amazon’s S3.

The article goes over installing the Net::Amazon::S3 Perl module via WHM (which is handy for the cPanel users). However, if you’re not a cPanel user, you can install it via CPAN:

# perl -MCPAN -e 'install Net::Amazon::S3'

If you’d rather install it through Webmin, go to the ‘Others’ section, and click ‘Perl Modules’.

Also, Tim mentions configuring a Firefox extension for accessing S3 that works very well. However, I find myself using Safari most often, so I prefer to use Jungle Disk or Transmit on my Mac.

Overall, it’s a great post, and I’m glad Tim told me about it!

Comments No Comments »

I’ve discovered one of the most awesome applications for a Mac called ScreenFlow (#3 on my list after #1 TextMate and #2 Adium and I decided to put it to use for my first screencast.

This screencast will teach you how to write a basic PHP script that will query data in MySQL. It is designed for users who are familiar with Linux but are just getting started with PHP. Here are the basic parts of the screencast:

» Import a MySQL dump file
» Connect to MySQL with PHP
» Select a default database
» Issue a query and retrieve results
» Style the rows retrieved into a table with alternating row colors

Download the screencast in Quicktime format (80.9MB)

NEW: Uploaded the video to Vimeo as well.

As always, your comments are welcome. This is my first screencast, and I’m sure I can make some improvements on future videos. Please let me know what I can change to make these screencasts better for you.

Comments 1 Comment »

I just received a Google Alert about MySQLTuner being the Debian Package of the Day!

Comments 5 Comments »

I’m really enjoying the Parallels Summit in Washington D.C. this week. The folks from Parallels have been great, and the vendors we have met are selling some pretty tremendous products.

Lots of folks have been asking for a summary of what’s going on after my Twitter posts appeared earlier today. Here’s the latest information I’ve seen and heard today:

Parallels Development Strategy
» Create an SMB edition, solidity the Application Packaging Standard (APS), and further integrate billing
» 80+ Research and development engineers currently work on Plesk products
» Increase density and make a more useable API
» Make Plesk the dominant panel through integration, SaaS deployments and scaling

Plesk 8 Series
» Plesk 8.4 brought DomainKeys and additional features
» Odd point revisions will contain minor bug fixes while even ones will contain new features
» Plesk 8.6 will have IPv6 support, full ModernBill integration and the APS software catalog

Plesk 9 Series
» Reseller level accounts will be available, and they will fit between the server administrator and client accounts
» Clients can be promoted to resellers
» Domain administrators can be promoted to clients (and resellers)
» Home and desktop pages will be merged
» Better rollover tooltips will be provided
» Hosting setup will be easier and setting limits will be more intuitive
» Server administrators will be able to hide certain services and functions
» Overselling will be allowed so that soft and hard limits can be set
» API improvements will be backward compatible
» Reseller billing will be integrated with ModernBill
» Choose to use Postfix rather than Qmail
» Greylisting is built into the panel

Plesk Future Ideas
» Vast majority of Plesk deployments have five domains or less
» SMB edition with support for one domain and one administrator (SaaS)
» Corporate fileserver and collaboration will be in the SMB version
» Use PHP via FastCGI rather than Apache module
» Lighttpd support for Plesk panel as well as hosted sites
» Multiple MTA’s (in addition to Postfix/Qmail)
» Upgrade checks can be run prior to upgrading Plesk so that issues can be avoided
» Recovery tools will be available for broken upgrades
» Local Plesk mirrors can be used to do remote upgrades
» Multiple level backup/restore options for admin, reseller, client or domain administrator
» Migration of shared hosting environment into Virtuozzo container or Plesk Server container
» SiteBuilder 5.0 will have mobile web site design support
» Event calendar is coming

ModernBill
» Will be integrated into Plesk
» Support for 20+ payment gateways
» 100% ready in Q4 2008

Application Packaging Standard (APS)
» Applications will be available directly from Parallels within the Plesk panel
» Modules are easy to install and update
» Applications can be maintained by packagers and kept up to date
» Centralized license management
» Installation and configuration can be completely scripted
» Install scripts can get Plesk configuration data right from Plesk so the interface within the application matches Plesk’s interface

Notes from Sergei’s Keynote
» Hosting growth is slowing, but it mature
» Managed hosting is growing a lot, and SaaS has entered the marked
» Mentioned Rackspace’s pending IPO as a sign of the changing market
» Large SaaS entries: Google’s products, Amazon’s S3/EC2, Microsoft’s Hosted Exchange
» Google is a monopoly, the most dangerous, won’t partner with anyone
» Microsoft works harder on partnerships, but was more dangerous without Yahoo!
» EMC quietly launched direct hosting, storage hosting, cloud computing
» IT is mocing off-premises, which is both a threat and opportunity
» Hosting companies must stay competitive via pricing, high levels of service
» Create stickyness with critical service offerings and owning the customer (and their data)
» Hosting companies can improve with broad sets of service plans, flexible upgrade paths, and close ties with customers/partners
» Parallels vision includes partnering, automation, virtualization, and standardization

I’ll try to take good notes tomorrow and get an update together for you then!

Comments 1 Comment »

I’ll be taking a short break from posting, but I should be back underway within week!  Here’s what I’m working on during the break:

  • MySQLTuner - Thank you for all of the e-mails with suggestions, patches and complaints. The 1.0 version of MySQLTuner is in the works and I hope that it helps you get more done with your MySQL server.
  • Boxcheck - A new version of boxcheck.com is coming and it will include more tests for you to use. Also, the tests that it already has will be more reliable. I might even throw in a little AJAX to get everyone excited.
  • PleskHacker - I’m still working on the Plesk database documentation, but this project is a lower priority than the first two.

I’m moving into a new house over the weekend, so please don’t be discouraged if you e-mail me and you don’t receive a quick response. For all of the fans of Twitter out there, you can find me on Twitter as RackerHacker.

Comments No Comments »

Normally, qmail will be able to process the mail queue without any interaction from the system administrator, however, if you want to force it to process everything that is in the queue right now, you can do so:

kill -ALRM `pgrep qmail-send`

If for some peculiar reason you don’t have pgrep on your server, you can go about it a slightly different way:

kill -ALRM `ps ax | grep qmail-send | grep -v grep | awk '{print $1}'`

Your logs should begin filling up with data about e-mails rolling through the queue.

Comments No Comments »

Upgrading Plesk from 7.5.x to 8.x will change your Plesk-related MySQL tables from MyISAM to InnoDB. This allows for better concurrency in the Plesk panel when a lot of users are logged in simultaneously. However, some server administrators will disable InnoDB support in MySQL to save resources. This will cause problems after the upgrade.

Plesk may display an error on a white page that looks something like:

Cannot initialize InnoDB

This could mean that InnoDB support was disabled when MySQL was started. To correct this issue, search through the /etc/my.cnf for this line:

skip-innodb

If you find it in your configuration, remove it, and then restart MySQL. To test that InnoDB is enabled, you can refresh the Plesk page, or you can log into MySQL and run SHOW ENGINES. The output from the SHOW ENGINES statement should show YES on the line with InnoDB.

Should DISABLED appear instead, you may have an issue with your InnoDB configuration in your /etc/my.cnf. Be sure to check for innodb_data_file_path and make sure that it is set to an appropriate value.

A value of NO is not a good sign. This means that your version of MySQL was compiled without InnoDB support. This means that it cannot be enabled at runtime because MySQL wasn’t built with any support for InnoDB. Be sure to recompile MySQL with --with-innodb or obtain a new package for your operating system which includes InnoDB support.

If you suspect that your MySQL InnoDB configuration is incorrect, you may want to review this documentation on MySQL’s site:

For MySQL 5: 13.2.3. InnoDB Configuration
For MySQL 4/3.23: 13.2.4. InnoDB Configuration

Comments No Comments »

After running the idea by some of my fellow technical folks, I’ve considered making an array of screencasts aimed to prepare people for the MySQL DBA exam. I haven’t decided to make them free or charge for them as of yet, but if I did charge a fee, it would be much less than getting the training from MySQL ($2,499USD in most locations).

So, I have two questions for the general techy community:

1. What tools/applications would you recommend on a Mac for making high-quality screencasts that have a professional feel?

2. Would you pay for these screencasts (if they are really good), and if so, how much would you want to spend in total to get all of the screencasts for the DBA certification?

Feel free to add comments to this post, or you’re welcome to drop me an e-mail at major at mhtx dot net. Your feedback is greatly appreciated!

Comments 2 Comments »