MySQL Overview and Installation
You are probably aware that MySQL has a lot to do with databases and you’re reading this because you want to know more about it – so let’s let’s start with asking the fundamental question of what exactly is MySQL?
A little background on MySQL
MySQL is one of the most widely used opensource database management systems in the world and, as of late 2017, only the proprietary Oracle database and the small embeddable SQLite are more widely deployed.
MySQL uses the SQL language with some modification but the My bit of MySQL is all down to the name of the eldest daughter of Ulf Michael Widenius, the main author of the original version of MySQL. Her name name is My.
Depending on who you talk to, the correct way to pronounce MySQL, or My Ess Que Ell, MySEQUEL is debatable but according to documentation, the correct pronunciation is My-S-Q-L, and that what we’ll do in course!
MySQL is opensource but it also has an owner. Currently MySQL is owned by the Oracle Corporation. In 1995, a company called MySQL AB released the first version. over a decade later, in 2008, Sun Microsystems purchased MySQL. Not long later, in 2010, Oracle purchased Sun Microsystems and with them came MySQL.
What is a database?
A very high level definition of a database is “an organized collection of data“. While this is true, we think that in addition to storing data, a database stores this data in such a way that meaningful information can be retrieved from it.
A Relational Database where information is presented in tables with rows and columns. The data within a table is not just a collection of independent objects but rather an organised collection of related rows of information records that facilitate organised retrieval of records.
This functionality is provided by a Database Management System (DBMS) which handles the way data is stored, maintained, and retrieved. In the case of a relational database, a Relational Database Management System (RDBMS) performs these tasks.
What exactly is MySQL?
MySQL is a relational database management system or a RDBMS. It uses a client-server model which means that the database typically runs on a server, typically this server will be the Apache web server running on a Linux, Windows or Mac operating system.
So what is a server? Generally speaking, a server is computer application that provides a service or services to other computer applications. These other applications can be on the same machine on on a remote machine.
The data stored by a database can be accessed over a network by clients which are applications designed for a specific task – a web browser is a great example of a client.
So MySQL is a system that uses the Structured Query Language or SQL to define, update and query the database and tables within it. SQL is hands down the most popular database system language and it is used on virtually all major relational database systems.
As mentioned earlier, MySQL is Open Source which means it has a very wide contributor base and is free! This also means it is going to be updated frequently but, as with all open source software, expect a few hiccups along the way.
One question we get asked a lot is why is there a Fish in the logo?
Well to be correct it is a Dolphin that was chosen as the MySQL mascot since it represents speed, power, precision and good nature – everything that a good opensource software aspires to be. Oh, and the dolphin has a name: Sakila.
Using MySQL
MySQL can be installed in a number of different ways.
- You can download the from the Oracle site and install it manually. This can be a great option for experience Database Developers or Administrators but perhaps not for beginners.
- A better option for those starting their MySQL journey, and the one we recommend for this course, is an all-in-one package that will install MySQL and other web development tools for you.
For now we’ll be using the latter option to get up up and running with the essentials of MySQL, and we recommend using XAMPP or one of its other flavours (WAMP, MANP or LAMP) that will install MySQL, the APACHE Web Server and PHP.
About XAMP
XAMPP is a completely free, easy to install Apache distribution containing MySQL and PHP, two opensource technologies that work beautifully together. We will be using PHP later in this course to create database driven content for web pages.
There are 3 core components of XAMPP are:
- the Apache web server
- MySQL
- PHP
Apache: The Web Server that will host your PHP/HTML pages, and facilitate PHP and MySQL run time environments. Everything hangs of your Apache server; this is the software that virtually every commercial hosting provider offers. There are others, but Apache is fully open source, robust, multiplatform web server, and free, making it very attractive and incredibly popular.
MySQL: Although owned by Oracle, it is an open-source database management system (DBMS) and uses the SQL language to manage databases.
PHP: Server side scripting language that will, among many other things, allow web pages interact with MySQL databases. If you are interested in PHP consider talking our PHP fundamentals course.
If you have not got it already, you can download your choice of all in one here:
- XAMP: https://www.apachefriends.org/download.html
- WAMP: http://www.wampserver.com/en/
- LAMP: https://bitnami.com/stack/lamp/installer
- MAMP: https://www.mamp.info/en/
Installation should be straightforward but some have an issue related to Port 80 which Apache will want to use. The main reason for this issue is that some other application or service is using port 80. You’ll need to figure out what is using it and stop it. There may be other issues… note them and try to fix them. Identify the PID of any application that is using one or more of the ports that Apache wants to use in the error logs. Use the Task Manager to identify the name of that application and remove/disable it.
Once you have MySQL (PHP and Apache) up and running with passwords set and all other configurations setup correctly we can move onto leaning how to create, read, update and delete databases and tables in the next lesson.