// author archive

Randy

Randy has written 39 posts for @randymelder

Identifying InnoDB Foreign Key Constraints

When using InnoDB tables in MySQL, the option exists to apply foreign key constraints. Data modelers do this for various reasons, which I’m not going to explore here. What’s important is that these constraints are religion for DBAs (and client software) and have to be respected to maintain data integrity. Knowing the hierarchy of data [...]

Use BASH to extract MySQL ACL list

Need to quickly extract all the GRANT info for your database users? Here’s a one-liner: for i in $( mysql -u readuser -pReadPassword -h your.host -e “SELECT CONCAT(user,’@\”,host,’\”) AS ACL FROM mysql.user ORDER BY user” -s ); do mysql -u readuser -pReadPassword -h your.host -e “SHOW GRANTS FOR $i” -s ; done ; Here’s a [...]

Using MySQL Stored Procedures for User Authentication

Scenario: You want to authenticate users into a private web site by accepting an e-mail address and a password. You don’t want to do a bunch of security on the front end however you do want to use a token on the client for various purposes. Also, you want the tokens to expire automatically and [...]

How to use Bash to extract Qmail accounts for OpenSRS import

Since I happen to be going through the pain of a bulk migration from Qmail to OpenSRS, I figured I can’t be the only one. Here’s a Bash script I wrote to extract Qmail users accounts into a CSV file. Enjoy! #!/bin/bash # # # Simple Email Account Extractor for Qmail # – Extracts username/password [...]

Creating a MySQL Function to convert miles and kilometers

MySQL has the ability to create user defined functions that can be called just like the built-ins. There was a recent project that involved some distance calculations. As part of the performance testing, we experimented with moving the logic around to different parts of the application stack. Here’s a short example of two functions created [...]

My wish list of O’Reilly titles

It’s shameless, I know… but these are some books I want to read: Ajax: The Definitive Guide Algorithms in a Nutshell AppleScript in a Nutshell bash Cookbook Building Cocoa Applications: A Step by Step Guide Cocoa in a Nutshell iOS 4 Programming Cookbook iPhone App Development: The Missing Manual iPhone Game Development JavaScript Cookbook JavaScript [...]

Testing MySQL data migrations Part 1

On occasion as database administrators we have to migrate data for various reasons. No matter the reason or the origin, we have to test the migration to see if the result is what we expect. The question is: How? In Part 1 of this series, I’m going to explore a simple “smoke test” of a [...]

Shocking your system into weight loss

As I’ve aged after about 25 years old, I’ve noticed that my metabolism is incredibly slow and weight loss using conventional means, balanced diet and exercise, was impossible. I’ve had to resort to research and experiments to find what works for me. Some of the conclusions I’ve made have been echoed in other diet books [...]

Group Lunch iPhone App

UPDATE! What’s New in Version 1.2 – Bug fix: Removed iAd support because it was crashing older phones. – Also recompiled build for ios 4.0 device compatibility. What’s New in Version 1.1 – Changed behavior so when the user begins edting a text field, it clears. – Added spin logo to about page. – Fixed [...]