You are on page 1of 23

MySQL

An Introduction

Databases 101

What is MySQL ?
MySQL is an open source relational database management system. It includes the SQL server and client programs for accessing the server. Widely used by web application developers, together with PHP and APACHE It is pronounced My-es-que-el (Or My-Sequel)

MySQL AB
MySQL AB is a commercial entity Marketing & Development Originally established in Sweden A virtual corporation Service and support Profitable since inception

Fact Sheet
100 million copies downloaded or distributed Certified for all SAP applications Elite client listYahoo!, NASA, Google, Youtube, Wikipedia, Facebook, Flickr, Nokia Key part of LAMP Proven track record

Why learn MySQL?


Leading open source RDBMS Free Easy to Use Fast Robust and Secure Multiple OS support Technical support Support large database up to 50 million rows, file size limit up to 8 Million TB

MySQL RDBMS SOURCE

Commercial License

GPL open source License

Embedded Database

Client-Server model Standalone server FREE

Service Support and Consulting

Which edition to use?


MySQL pro certified server V.S. MySQL community edition

Where can I get MySQL ?


If you want to install it manually:
http://dev.mysql.com/downloads/ mysql/
Make sure you pick the correct version for your OS

Command line utilities


see handout later

GUI
Download MySQL Administrator Download MySQL Query Browser

Another tool: phpMyAdmin


An open source tool written in PHP intended to handle the administration of MySQL with the use of a Web browser. It can perform various tasks such as creating, modifying or deleting databases, tables, fields or rows; executing SQL statements; or managing users and permissions.

XAMPP
XAMPP is an easy to install Apache distribution containing MySQL, PHP and phpMyAdmin. XAMPP is really very easy to install and to use - just download, extract and start.

How to Download XAMPP


http://www.apachefriends. org/en/xampp.html Click the for Windows or for Mac OS X link

If Youre Using a Mac


Download .dmg file Open the DMG-image, and dragndrop the XAMPP folder into your Application folder Open XAMPP Control Go to http://localhost in your browser, and click phpMyAdmin on the left
Start Apache Start MySQL

If Youre Using a PC
Download .zip file Unzip the zip archives into the folder of your choice.

If Youre Using a PC - 2
If your folder is not C:\, go to your selected target directory, and start the file setup_xampp.bat, to adjust the XAMPP configuration to your system.

If Youre Using a PC - 3
Start the universal control center: XAMPP Control Panel at \xampp\xamppcontrol.exe

If Youre Using a PC - 4
Go to your browser and input http://localhost/ or http://127.0.0.1/: Click phpMyAdmin on the left-bottom

How to Select DB and Table

How to Run SQL:

About Data types


Detailed help in describing your fields can be found online at the MySQL user manual. These two links are very helpful
http://dev.mysql.com/doc/refman/5.5/en /string-types.html http://dev.mysql.com/doc/refman/5.5/en /numeric-types.html

In General: Refer to chapter 10 of the user manual at http://dev.mysql.com/doc/refman/5. 5/en/data-types.html

Quick Example of data types

Word of advice ..
Describe your fields correctly Describe your data tightly Secure your server well Understand the mechanics Use the manual Use the mailing list

Storage engine and table types


MyISAM
Indexed Sequential Access Method Fastest table type in MySQL Originally used in mSQL by TcX (the predecessor of MySQL AB) Do not support transactions and foreign key Default prior to MySQL 5.5.5 Purchased by MySQL later Large data volume, heavy-load production system Support transactions and foreign key Default as of MySQL 5.5.5

InnoDB

You might also like