MySQL Installation on macOS

This section describes how to download, install and start MySQL server on macOS systems.

MySQL database server is a good alternative to Oracle and SQL Server, if you are looking for a free database server. Here is what I did to install MySQL database on macOS.

1. Go to MySQL download Website at

2. Click "Download" next to "macOS 10.14 (x86, 64-bit), DMG Archive". Enter your Oracle login name and password to start the download.

3. Double-click the download file mysql-8.0.17-macos10.14-x86_64.dmg in the Downloads directory to start the installation.

4. Select "Legacy password encryption" to avoid trouble using the new password encryption method.

5. Set the root password to "DontTellAnyOne", and follow instructions to finish.

6. Verify the MySQL server daemon with the "ps" command:

herong$ ps -ef | grep mysqld
   74 94827     1   0  9:35PM 0:01.73 /usr/local/mysql/bin/mysqld \
   --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data \
   --plugin-dir=/usr/local/mysql/lib/plugin --user=_mysql \
   --log-error=/usr/local/mysql/data/mysqld.local.err \
   --pid-file=/usr/local/mysql/data/ \
   --keyring-file-data=/usr/local/mysql/keyring/keyring \ \

7. Connect to the MySQL server with the "mysql" client program:

herong$ /usr/local/mysql/bin/mysql -u root -p
   Enter password: DontTellAnyOne

 mysql> show databases;
| Database           |
| information_schema |
| mysql              |
| performance_schema |
| sys                |
4 rows in set (0.00 sec)

The next step is to add "/usr/local/mysql/bin/" to the environment PATH variable to void typing the path name when invoking MySQL commands.

Table of Contents

 About This Book

 JDBC (Java Database Connectivity) Introduction

 JDK (Java SE) Installation

 Installing and Running Java DB - Derby

 Derby (Java DB) JDBC Driver

 Derby (Java DB) JDBC DataSource Objects

 Java DB (Derby) - DML Statements

 Java DB (Derby) - ResultSet Objects of Queries

 Java DB (Derby) - PreparedStatement

MySQL Installation on Windows

MySQL Installation on macOS

 MySQL Installation on Windows

 mysqladmin - MySQL Admin Tool

 mysql - Command Line Tool

 Creating Database and User with MySQL Monitor

 MySQL JDBC Driver (MySQL Connector/J)

 MySQL - PreparedStatement

 MySQL - Reference Implementation of JdbcRowSet

 MySQL - JBDC CallableStatement

 MySQL CLOB (Character Large Object) - TEXT

 MySQL BLOB (Binary Large Object) - BLOB

 Oracle Express Edition Installation on Windows

 Oracle JDBC Drivers

 Oracle - Reference Implementation of JdbcRowSet

 Oracle - PreparedStatement

 Oracle - JBDC CallableStatement

 Oracle CLOB (Character Large Object) - TEXT

 Oracle BLOB (Binary Large Object) - BLOB

 Microsoft SQL Server Express Edition

 Microsoft JDBC Driver for SQL Server

 Microsoft JDBC Driver - Query Statements and Result Sets

 Microsoft JDBC Driver - DatabaseMetaData Object

 Microsoft JDBC Driver - DDL Statements

 Microsoft JDBC Driver - DML Statements

 SQL Server - PreparedStatement

 SQL Server CLOB (Character Large Object) - TEXT

 SQL Server BLOB (Binary Large Object) - BLOB

 JDBC-ODBC Bridge Driver - sun.jdbc.odbc.JdbcOdbcDriver

 JDBC-ODBC Bridge Driver - Flat Text Files

 JDBC-ODBC Bridge Driver - MS Access

 JDBC-ODBC Bridge Driver - MS SQL Server

 Summary of JDBC Drivers and Database Servers

 Using Connection Pool with JDBC

 Archived Tutorials


 Full Version in PDF/EPUB