Glassfish Starting Places

pageicon Monday May 19, 2008

Glassfish + MySQL - Setup for MacOS

Glassfish + MySQL on Mac

Setup on MacOS

     With the recent release of the Glassfish (Application Server) and MySQL distribution, and because MacOS in not an official supported product,  I've decided to post the setup instructions that allowed me to use this excellent combination of technology on my MacOS machine.  To access the bundle and for the setup instructions, please see Sathyan's blog.  

Configuring the Database

To start, go to the Glassfish installation directory. 
  • For example, install under /Users/alexp/glassfish.  Let's call it GF_HOME.
 Go to mysql directory and change the group owner.  For example,
  • cd $GF_HOME
  • sudo chgrp -R mysql $AS_HOME/mysql (you will be asked to provide your login passwd).
Execute the install scripts.  For example,
  • cd $GF_HOME/mysql
  • sh ./scripts/mysql_install_db
  • sudo chown mysql data
Start the database.  For example,
  • cd $GF_HOME/mysql
  • sudo ./bin/mysqld_safe --defaults-file=./mysql.ini --user=root &
On the screen a message will pop up with the following text:
"Starting mysqld daemon with databases from /Users/alexp/glassfish/mysql/data"

Testing the setup

To verify, you can do the following basic test as follows:
  • cd $GF_HOME/mysql
  •  ./bin/mysql -u root -p
You should get MySQL prompt and try the following,
  • mysql> show databases;   (shows default databases)
  • mysql> create database dbstemp;
  • mysql> show databases;   (it should show the dbstemp in the database list).

Comments:

Post a Comment:
  • HTML Syntax: NOT allowed