Install MAMP which will allow you to use MySQL and JDBC on your Mac OS X.
Continuing from section 1 above, a MySQL server (MAMP) should be running at this point. Let us start a MySQL client shell and access the server. Try the following steps:
     shell> /Applications/MAMP/Library/bin/mysql -u root -p
     
     and use root as the password to continue.
     shell> mysql -u root -p
    
     mysql> show databases;          // don't forget the ';'
     
     mysql> create database artlee;
     
     mysql> grant all privileges on database.* to user@localhost identified by 'password';   // include the single quotes
     
     where database is the name of a database,
     user is the name of a new user, and password
     is a password.  For example, I
     used artlee, art, and lee
     for database, user, and password,
     respectively. Don't forget the single quotes.
     mysql> grant all privileges on database.* to user@"%" identified by 'password';
     
     where @"%" acts as a wildcard for access to the database
     from any client machine.  Here again database is the
     name of a database, user is the name of a user,
     and password is a password.  For example, I
     used artlee, art, and lee respectively.
     mysql> help;
     
     mysql> use artlee;
     
     mysql> drop database if exists artlee;
     
     mysql> source /Users/alee/cse305/db/db.sql;
     
     Take a look at the content of the script file db.sql. By
     the way, how would you create a script file?  Use your favorite
     text editor.
     mysql> quit;
     or
     mysql> exit;
     
     mysql> drop database if exists artlee;
     
     mysql> create database artlee;
     
     mysql> use artlee;
     
     mysql> create table Accounts (ID INTEGER, Balance INTEGER);
     
     mysql> show tables;
     
     mysql> SELECT * FROM Accounts;
     
     Use this again below to see if insert worked or not when you try
     inserts below.
     
     mysql> insert into Accounts VALUES (1, 11);
     mysql> insert into Accounts VALUES (2, 22);
     mysql> insert into Accounts VALUES (3, 33);
     
     mysql> SELECT Sum(Balance) FROM Accounts;
     
     mysql> create table Names (id integer, dob date);
     mysql> insert into Names values (1, "2021-03-02");
     mysql> insert into Names values (2, "2019-03-20");
     mysql> insert into Names values (3, "2017-01-20");
     
     mysql> SELECT * FROM Names, Accounts;          -- (+)
     
     Use '--' to add a comment.
     
     mysql> SELECT * FROM Names, Accounts WHERE Names.ID = Accounts.ID;
     
     mysql> SELECT * FROM Names, Accounts WHERE Names.ID = Accounts.ID 
            AND DOB < Date("2021-01-01");
     
     mysql> SELECT Names.id, Balance, DOB from Names, Accounts WHERE
            Names.ID = Accounts.ID AND DOB < Date("2021-01-01");
     Up till now, we saw how a client communicates with a database server through command line interface. In this section, I describe how a Java program as a client communicates with a database server. Java does it through a connector called JDBC. I assume that you have MySQL (in MAMP) installed by now.
Find a Java connector, MySQL Connector/J, from http://dev.mysql.com/downloads/connector/j/.
I downloaded mysql-connector-java-8.0.23.zip (the latest at the time of this writing). When you unpack it, you will see a file that looks like this:
mysql-connector-java-8.0.23-bin.jarTo make compilation simpler, add this jar file to the CLASSPATH in .profile (adjust it if you are not using a Bourne-compatible shell) in your home directory. My CLASSPATH looks like this:
  CLASSPATH=".:/Users/alee/cse305/mysql-connector-java-8.0.23/mysql-connector-java-8.0.23-bin.jar:${CLASSPATH}"
  export CLASSPATH
  
  
Now, download, compile, and run Bank1.java which will bring in DB.java. They use JDBC. Be sure to read the comments at the top of Bank1.java to see how to run it.
If This Does NOT Work and nothing else could be tried to make it work, uninstall MAMP and anything else that could have installed MySQL, and then follow the instructions very carefully from the very beginning. Some students had to that and it worked for them.
That's it!