MySQL Tutorials

Here you’ll find the start of a collection of articles primarily on MySQL. Some are for new developers, while others are for database administrators to help them to do their jobs. Many of these articles were published in software magazines. Click on the heading of the article to read it on this site; click on the name of the publication below the article’s description to see it on the site where it was originally published.

MySQL Basics

This tutorial is an article for the beginner who wants to get started quickly without having to invest a lot of time and money in books on MySQL. It includes straightforward examples.

Getting Data out of MySQL

This is a basic tutorial for retrieving data from an existing MySQL database and its tables.

Adding and Changing Data in MySQL

This basic tutorial explains how to add data to a MySQL database using the mysql client. It covers the INSERT, REPLACE, and UPDATE statements.

MySQL String Functions

In this basic tutorial, many string functions which are available in MySQL are explained. It provides examples for each, showing the more common syntax.

Doing Time with MySQL

This article is from basic to intermediate level on using time functions in MySQL. It covers storing, retrieving, altering, and formatting dates and times. Many examples are included.

Changing Times in MySQL

This is a basic tutorial on working with time functions in MySQL. It covers storing time in a table column, retrieving it and formatting it to your preferred style. It also explains the process of altering dates. Many examples are provided.

Restoring Data from Dump Files

If you lose your data in MySQL, but have been using mysqldump to make regular backups of your data in MySQL, you can use the dump files to restore your data this is the point of the back-ups, after all. To restore a mysqldump file, it's just a matter of having the mysql client execute all of the SQL statements that the file contains. There are some things to consider before restoring from a dump file, so read this section all of the way through before restoring. One simple and perhaps clumsy method to restore from a dump file is to enter something like the following:

Altering Tables in MySQL

After you have started creating tables in MySQL and then have added data, at some point you will need to alter your tables. This article explains the basics of using the ALTER TABLE statement and gives examples of the many clauses with it.

Making Backups with mysqldump

Perhaps the best utility for making back-ups of data in MySQL is mysqldump. It’s free with MySQL and it doesn’t require you to shut down MySQL to use it. It retrieves data and table schema from each database and exports all to a simple text file. It’s quick and easy to use. This article explains the basics of how to use this utility and it provides examples.

Importing Data with MySQL

When you’re migrating data or otherwise need to bulk import data into MySQL, you’ll need to use a utility like mysqldump or the LOAD DATA INFILE statement in MySQL. This article explain how to use them.