MySQL

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.

Tutorials

  • DROP DATABASE statement

    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:

    Read more…

  • CREATE USER & GRANT PRIVILEGES in MySQL

    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…

    Read more…

  • Updating with MySQL Installer on Windows

    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…

    Read more…

  • CREATE DATABASE statement

    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…

    Read more…

  • CREATE TABLE statement

    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…

    Read more…

  • MySQL column aliases

    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.

    Read more…

  • MySQL sub-query

    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…

    Read more…

  • MySQL TRIGGER

    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…

    Read more…


References:

  1. Wikipedia. Wikimedia Foundation (2024) MySQL. Available at: https://en.wikipedia.org/wiki/MySQL (Accessed: 10 September 2024).
  2. MariaDB (no date) Download MariaDB Products & Tools. Available at: https://mariadb.com/downloads/ (Accessed: 10 September 2024).