Install MySQL Database Server on macOS

This section provides a tutorial on how to install MySQL database server on macOS.

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 https://dev.mysql.com/downloads/mysql/.

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 "TopSecret", 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/mysqld.local.pid \
   --keyring-file-data=/usr/local/mysql/keyring/keyring \
   --early-plugin-load=keyring_file=keyring_file.so \
   --default_authentication_plugin=mysql_native_password

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

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

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

9. To start/stop MySQL server with System Preferences tool:

System Preferences > MySQL > Start

System Preferences > MySQL > Stop

10. To shutdown MySQL server with "mysqladmin" command:

herong$ /usr/local/mysql/bin/mysqladmin shutdown -u root -p
  Enter password: TopScret

Table of Contents

 About This Book

 Macintosh OS (Operating System) History

 macOS Operating System

 macOS File Systems

 macOS Network Connections

 System and Application Processes

 Keychain Access - Password Manager

 Keychain Access - Certificate Manager

 Productivity Tools on macOS

Programming Tools on macOS

 Run Perl Scripts on macOS

 Install File::Util for Perl

 Run Python Scripts on macOS

 Install New Version of Python on macOS

 pip3 - Package Installer for Python 3

 Run PHP Scripts on macOS

Install MySQL Database Server on macOS

 PHP mysqli_connect() Error on "localhost"

 Install SQuirreL SQL Client on macOS

 Connect SQuirreL to MySQL on macOS

 Install SQuirreL SQL Scripts Plugins

 Apache Web Server on macOS

 Develop and Run Java Applications

 Full Version in PDF/EPUB