Category Archives: #LearnMySQLNow

Installing MySQL and MariaDB (Videos)

Awhile back, I wrote up some instructions for doing a basic install of MySQL on Windows, including the steps to secure it. Now that I’m working on another MySQL book, I decided to start putting together some videos to go with it and I’ve created a couple on MySQL / MariaDB installation.

These videos include both the basic manual and the MSI wizard installs. While MariaDB is a drop-in replacement for MySQL and similar in most respects, there are some minor differences that have crept in, including during installation. For that reason, it’s good to be familiar with both.

The options available during the MSI installs are also pretty different. MySQL still uses MySQL Workbench for it’s GUI and while Workbench will work with MariaDB, it tends to complain about it. HeidiSQL is included as an option in the MariaDB install.

All the options are, of course, available on their respective download pages.

MySQL: https://dev.mysql.com/downloads/mysql/

MariaDB: https://downloads.mariadb.org/



Upcoming book - "Understanding MySQL and MariaDB"
Download a FREE sample chapter!
The ability to work with data and the systems that store it is a fundamental career skill and will remain one for many years to come. Understanding MySQL and MariaDB is an upcoming book that will guide you in learning about two of the most popular database software titles in the world today.  More than a textbook, it will combine quality instruction with online resources to help you understand the concepts you need to work with database technology and add more skills to your resume.

Check out the official book page or sign up for the newsletter to learn more about this upcoming resource!




A Few Thoughts on the Book Writing Process

It Seems Like I’ve Been Here Before …

People seem fairly impressed when I mention that I’ve written a couple of books on databases and software. I try not to make a big deal of it, just mentioning it in passing as appropriate, because I actually don’t consider it to be a big deal. I’m one of those people who likes to share knowledge, likes to write and has accumulated a decent amount of knowledge on a few things. Occasionally, that knowledge demands to be organized and backed up in article or book form. There’s also been the hope that others will find it useful in their own lives and might actually pay for it.

Continue reading

How to Perform a Basic MySQL Installation in Windows

One of the nice features of MySQL as a database software is its noinstall option in which you download the files themselves and perform a manual installation that takes just under a gigabyte of space on your drive.  If you’re a developer or a student, this means you can quickly create a new self-contained instance wherever you need it and then blow it away if you need to without cluttering up your registry.

This does mean working on the command line so you’ll want to have a certain comfort level with that.  You will also need to be working with Administrative privileges.

Continue reading

How To Create a Local WordPress site with XAMPP

XAMPP is one of many AMP software stacks (Apache – MySQL – PHP) that can be used to create a local web development environment for design and testing.  It automatically installs and configures Apache as a web server so that you can view your pages through http://localhost, MySQL as a database server for website data and PHP to render any PHP code within your pages.

Once you have XAMPP installed, you can install WordPress or other content management systems locally so that you can easily develop and test your web content and programming before uploading it to the web or an intranet.  I also use WordPress as a local CMS for organizing my own content.

Setting up XAMPP and WordPress takes as little as 10 minutes and can be done either on your hard drive or a USB flash drive as I show in this video. The flash drive option is a little slower but it is easily portable between systems as XAMPP runs entirely from the directory it’s installed to.

Downloads: XAMPP is developed by ApacheFriends and maintained by Bitnami. The download is available through SourceForge or from ApacheFriends.org: https://sourceforge.net/projects/xampp/ https://www.apachefriends.org/index.html

The latest version of WordPress is available from WordPress.org. https://wordpress.org/download/


Upcoming book - "Understanding MySQL and MariaDB"
Download a FREE sample chapter!
The ability to work with data and the systems that store it is a fundamental career skill and will remain one for many years to come. Understanding MySQL and MariaDB is an upcoming book that will guide you in learning about two of the most popular database software titles in the world today.  More than a textbook, it will combine quality instruction with online resources to help you understand the concepts you need to work with database technology and add more skills to your resume.

Check out the official book page or sign up for the newsletter to learn more about this upcoming resource!



Calculated Fields in CiviCRM

One of CiviCRM’s strengths is the ability to add custom fields to hold specific information about your contacts. One thing it doesn’t offer (yet) is a calculated field type that will present the results of calculations of other fields.  While calculated fields are generally discouraged in relational database design, they are sometimes necessary within a user interface. One suggested method is to add custom code hooks within CiviCRM’s PHP code but as a database guy, I decided on a back-end solution.

Continue reading

Importing Case Data into CiviCase

Migrating to CiviCase

On a recent project, I setup CiviCRM and CiviCase to enable a local organization to better manage its client database. The old database had been developed in Borland Paradox and was quickly becoming unusable. As a free and open source solution, CiviCRM turned out to be just the solution needed to accommodate this non-profit.

While CiviCRM itself does allow for the import of data through its API interface, I found that the contacts importer rejected a good portion of this data. The data had been entered by many volunteers into a database which did not impose many constraints on what data was required or how it could be entered. As with any case history, this data was essential to working with clients. With the volume of data involved, manual re-entry was not an option.

Fortunately, while CiviCRM’s data model is sophisticated, it’s relatively easy to decipher and I was eventually able to import the bulk of the data into CiviCase using a series of MySQL queries and MySQL Workbench.

Continue reading

MySQL User Defined Function Example: Data Cleanup

(Updated June 9, 2016)

The Challenge

One of my current projects involves migrating a large amount of data away from an old custom Borland Paradox application into a new CiviCRM system. As with too many quickly-constructed apps, this old Paradox database wasn’t especially well designed and, among other the other challenges in salvaging the data, there were no restrictions on how dates could be entered. This means that, in multiple fields within each of the 20,000+ database records, I might see any of the following:

03-14-96
5/20/1975
10/02/83
09051975
07.19.1995
19830211121500

While CiviCRM does have a utility for importing data from CSV and other SQL tables, it was having quite a time with this collection and many of the dates were being mishandled. That’s if the records weren’t rejected entirely for other reasons. Data migration doesn’t often happen with just a few settings adjustments and a click of the Import button.

Continue reading

Installing MySQL on Mac OS X El Capitan

A few months ago, I wrote about how to install MySQL on Windows with IIS. Now I want to show you how to create an AMP web programming stack (Apache, MySQL & PHP) on Mac OS X. As with Windows, you could just go with a ready-made development environment like MAMP but, if you’re going to be doing real database and web design work with MySQL, it’s best to know how everything works.

Background

For this demonstration, I’m going to be using Mac OS X El Capitan (v.10.11), the latest version as of this writing.  My installation environment is a hosted Mac server with 1 GB of RAM and 40 GB of disk space. I will be demonstrating the process using the Terminal commands.

Unlike Windows, OS X already includes the Apache web server and PHP language pre-installed so it’s a much simpler process to ensure that everything is working together. You will need root access in order to install and configure the components.

Continue reading

A Complete Guide to Installing MySQL and PHP with IIS

Note:  This article was written in 2015 and is in the process of being updated.  It is still useful as a general guide for issues you might encounter in this type of installation. Please take this into consideration when downloading components.


One of my latest projects was setting up WordPress, the popular content management system, on a client’s web server which was running Windows Server 2008. WordPress requires installations of MySQL for the database back-end and the PHP scripting language in order to serve up the WordPress content. On a local Windows machine, I’d probably just use a pre-configured WAMP (Windows, Apache, MySQL, PHP) stack package like XAMPP which is installed quickly and includes all the necessary components. That’s not quite an option in a professional environment, though. I was also working with Internet Information Services (IIS) 7.5 for the web server instead of Apache so the process is a little more involved.

Click here to read more about using XAMPP to create a local installation of WordPress.

Continue reading

Fixing the Orange (or Red) Status Icon in WampServer

As part of my latest project, I decided to try out WampServer, the Windows development environment for developing web applications with Apache web server, MySQL database and PHP scripting (Windows, Apache, MySQL, PHP – WAMP). Packages like WampServer and EasyPHP are simplified ways to create a testing environment on your PC without spending a lot of time downloading, installing and configuring the individual components. The package also includes utilities such as PHPMyAdmin and SQLBuddy for managing your MySQL databases and writing SQL queries. The software is available in 32- and 64-bit versions and the installation is pretty straightforward.

Continue reading