1. Computing

Discuss in my forum

MySQL Quick Start Guide

By , About.com Guide

It's time to gear up for back to school. Whether it's high school or college, if programming is in your future you probably want to get a head start with some basic concepts. In this article we'll look at some key ideas of MySQL that you can start learning now so things will come more easily to you in class. Even if you don't master the ideas right away, being familiar with them before they are presented will be a big help!

First, you need a place to run MySQL. You may choose to do so at your hosting company, as most hosting comes with everything setup and ready to go. You could also install MySQL directly on your computer. This will work whether you have a Windows or a Mac computer. Having it on your computer has the advantage of also working while you are offline. Having it online at your hosting means you don't have to install it yourself, and you aren't taking up any space on your computer...but you often have to pay a monthly fee.

You probably want to familiarize yourself with phpMyAdmin. It is a very commonly used tool to work with your MySQL database. If you know for sure that your class with be using something else you should get that instead. phpMyAdmin lets your browse and edit your database with ease. You can do lots of editing without any programming, but you can also enter SQL commands directly from phpMyAdmin.

Before you can do anything else, you need to create a database...that is why you are learning MySQL! This is done with one very simple line:

create database DataBaseName;

The next thing you will want to do is create some tables for your database. This tutorial shows you a simple way to create new tables in your database using phpMyAdmin. You can choose the table's name, how many fields it will hold and the types of fields that you will need. You can create as many tables as you need.

Sometimes when you are creating a new database you will run into problems, or need to make changes to your database for some other reason. That's not a problem, it's easy to alter existing tables. You change the tables name, change data types, add or drop columns, or really whatever needs to be done.

One thing you want to be sure to do on a regular basis for any database that you actually use is to create backups. phpMyAdmin makes it very easy to backup your database if you like the interface. You can also backup your database from the command prompt. This article shows you both ways of backing up your MySQL database, as well has how to use your backup files to restore your database should you ever need to. It's easy to forget to backup because it never seems terribly useful... until the worst happens!

Once you have these basics it's just a matter of weaving them all together in different ways to create databases, modify them, back them up, restore them, and use them with your PHP projects.

If you are interested in MySQL mostly to work with PHP I would recommend this article: Using MySQL with PHP on your website. In the article I show you how to connect to your new database from a PHP file. From here you can control MySQL by using commands like you would at a command prompt. All of the information you learned works the same, only it is routed through PHP.

Hopefully with a bit of knowledge going in you will be able to get a jump start on your learning and excel in programming this school year. Best of luck!

  1. About.com
  2. Computing
  3. PHP / MySQL
  4. Learn MySQL
  5. MySQL - Back to School

©2013 About.com. All rights reserved.