MySQL Tutorials - Herong's Tutorial Examples

http://www.herongyang.com/MySQL

Copyright © 2000-2019 by Dr. Herong Yang. All rights reserved.

MySQL Tutorials This free MySQL tutorial book is a collection of notes and sample codes written by the author while he was learning MySQL himself, an ideal tutorial guide for beginners. Topics include introduction of Structured Query Language (SQL); installation of MySQL; using MySQL client program; accessing MySQL from PHP, Java and Perl programs; SQL data types, literals, operations, expressions, and functions; Statements of Data Definition Language (DDL), Data Manipulation Language (DML), and Query Language; stored procedures; transaction management; locks and deadlocks. Updated in 2019 (Version Version 4.30): added MySQL 8 tutorials.

Table of Contents

About This Book

Introduction of SQL

What Is SQL?

SQL History and Revisions

SQL and Database Terminologies

MySQL Introduction and Installation

What Is MySQL?

Downloading and Installing MySQL

Issues during MySQL Installation

Starting and Stopping MySQL Server

Un-Installing MySQL

MySQL Command Line Client Tool

What Is MySQL Shell

What Is MySQL Workbench

Using MySQL Noinstall Package

MySQL Data Directory Initialization

Creating MySQL Windows Service

%mysql% Variable for MySQL Server Path

Introduction of MySQL Programs

List of MySQL Programs

mysqld - The MySQL Server Program

mysqladmin - The Client Tool for Administrators

mysql - The Client Tool for End Users

Using "mysql" Command to Run SQL Statements

mysqldump - Dumping Data to Files

--secure-file-priv="" - MySQL Server Option

mysqlimport - Loading Data from Files

PHP Programs and MySQL Server

Configuring PHP for MySQL Server Access

MySQL Authentication Method "caching_sha2_password"

mysqli_connect() and Other MySQL Functions

MySqlLoop.php - MySQL Functions Test

Perl Programs and MySQL Servers

Accessing MySQL Servers from Perl Programs

HelloMySQL.pl - Sample Perl Program to Use MySQL

Java Programs and MySQL Servers

MySQL Connector/J - Download and Installation

Loading JDBC Driver Class - com.mysql.cj.jdbc.Driver

JDBC Driver Connection URL

Connection URL Tests on Older MySQL Connector/J

Creating Connections with DataSource Class

Getting Driver and Server Information

Creating Tables with AUTO_INCREMENT Columns

"INSERT INTO" Statements

Datatypes and Data Literals

Introduction of Datatype

Data Binary Representations

Data Literals

Data Literal Evaluation

Character String Literal Evaluation Examples

Hex String Literal Evaluation Examples

Numeric Literal Evaluation Examples

Operations and Expressions

What Is Expression

Arithmetic Operations

Predicate Operations

Date and Time Operations

Examples of Different Types of Operation

Character Strings and Bit Strings

Operatins and Functions for Character Strings

Operatins and Functions for Bit Strings

Commonly Used Functions

Flow Control Functions

Character String Functions

Numeric Value Functions

Date and Time Functions

JSON Document Functions

XML Document Functions

Spatial Data Functions

Cast Function

Table Column Types for Different Types of Values

Table Column Types for Character Strings

Table Column Types for Byte Strings

Table Column Types for Bit Strings

Table Column Types for Exact Numbers

Table Column Types for Approximate Numbers

Table Column Types for Date and Time Values

Table Column Types for LOB (Large OBject)

Table Column Types for Look Up Values

Table Column Types for JSON Documents

Table Column Types for Spatial Geometry Data

Using DDL to Create Tables and Indexes

CREATE TABLE - Statement to Create Tables

Column Options When Creating Tables

CREATE INDEX - Statement to Create Indexes

ALTER TABLE - Statement to Alter Table Structures

Using DML to Insert, Update and Delete Records

INSERT INTO - Statement to Insert Records to Tables

UPDATE - Statement to Update Records in Tables

DELETE FROM - Statement to Delete Records from Tables

Using SELECT to Query Database

SELECT Statements

FROM Clause of a SELECT Statement

JOIN - Operation to Join Two Tables

JoinTable.sql - Example of Join Tables

WHERE Clause of a SELECT Statement

GROUP BY Clause of a SELECT Statement

ORDER BY Clause of a SELECT Statement

Transaction Management and Isolation Levels

Locks Used in MySQL

Defining and Calling Stored Procedures

What Is a Stored Procedures?

CREATE PROCEDURE - Statement to Create Stored Procedures

Stored Procedure Parameters

Variables, Loops and Cursors Used in Stored Procedures

Outdated Tutorials

Outdated: Installing MySQL 5.7.10 with Installer

Outdated: Issues MySQL 5.7.10 Installer

Outdated: MySQL Connector/J 5.1 Installation

Outdated: Installing MySQL 5.6.28

Outdated: Installing MySQL 5.5.15

Outdated: Installing MySQL 5.0.2 (Alpha)

Outdated: Installing MySQL 4.0.18

References

Full Version in PDF/EPUB

Keywords: MySQL, SQL, Language, Database, Tutorial