
MySQL started as an open-source project. In 2010, Sun Microsystems (now Oracle) bought MySQL. At the same time as it was sold, the project was forked to create MariaDB. [1] Both MySQL & MariaDB offer Community & Enterprise versions. [2]
MySQL is a well-known open-source database. It forms part of the WAMP/LAMP stack and is behind other well-known software giants like WordPress.
Setup
I am running a vanilla WAMP dev box and most of the work here is related to working on a dev box and not a production setup. This is especially relevant as I have made almost no provision for security in posts and tutorials.
- Installing Apache on a Windows dev box
- Install & configure Apache HTTP Server as your web server
- Installing the MySQL Installer on Windows
- MySQL Installer is possibly the easiest way to install and manage your MySQL Server and MySQL Workbench, which together are all you need to get going with MySQL
- Installing phpMyAdmin
- Not necessary if you have MySQL Installer on your local machine, however, your production box will almost certainly be a remote server and you will need to know how to use phpMyAdmin
- Installing PHP on a Windows dev box
Tutorials
-
DROP DATABASE statement
Equally as simple as the CREATE DATABASE statement, the DROP DATABASE statement will destroy an entire database. This tutorial uses MySQL Workbench. In this tutorial: Required knowledge: Syntax DROP DATABASE `databasename`; Example Continuing from the CREATE DATABASE statement tutorial, we will now DROP the database in MySQL Workbench using the following SQL: DROP DATABASE `dbtest`; References:
-
CREATE USER & GRANT PRIVILEGES in MySQL
A MySQL database has a default, root user that is able to do anything on the server and to the databases created on the server. This includes dropping (deleting) entire databases. In this tutorial: Required knowledge: SELECT users You can see the users on a MySQL server at any time using the statement: SELECT user…
-
Updating with MySQL Installer on Windows
The MySQL Installer is a simple and intuitive utility for managing your MySQL database needs. I use it on my Dev box. After quite some time I decided it was time for an update. In this post: See also: 1. Current Make a note (or simply take a screenshot or two) of your current product…
-
CREATE DATABASE statement
What would seem like a complex task — creating a new database — is possibly the simplest statement of all! In this tutorial: See also: Syntax The syntax is extremely simple: CREATE DATABASE `databasename`; Naming conventions for databases vary. Stick to a short, simple, descriptive name consisting of lowercase letters only and you can’t go wrong. Example…
-
CREATE TABLE statement
This post is aimed at Information Technology (“IT”) students in DBE and IEB schools. When learning the Structured Query Language (“SQL”) portion of the syllabus, ideally you want to be using Microsoft SQL Server, or MySQL. If you are using Microsoft Access, you should specifically be aware of the difference in data types and SQL…
-
MySQL column aliases
In the process of refactoring some MySQL queries in some PHP code, I came across some interesting syntax for field aliases in the existing code and poked around a bit to see what syntax variations exist in MySQL.
-
MySQL sub-query
I have blogged before about simplicity in code: how the simplest solutions are usually the best, and I normally put it down to elegance. In this tutorial: 1. Table I have the following table:tblTagstagID (int, PK)tagName (varchar)tagParent (int) tblTags is populated with data as follows: tagID tagName tagParent 1 Food& Beverage 0 2 Security 0…
-
MySQL TRIGGER
I battled for ages to find the correct syntax to create a trigger in MySQL — the examples I could find were all too complex and I could not get any of them to work. Here is a quick little example that you should find easy to follow. I completed this exercise using HeidiSQL , but…
References:
- Wikipedia. Wikimedia Foundation (2024) MySQL. Available at: https://en.wikipedia.org/wiki/MySQL (Accessed: 10 September 2024).
- MariaDB (no date) Download MariaDB Products & Tools. Available at: https://mariadb.com/downloads/ (Accessed: 10 September 2024).