Question

I just have learned about IBM Worklight, and I was wondering of how to set up and configure MySQL database. I've set Worklight Adapter, but, I have no clue of how to make database with MySQL.

Was it helpful?

Solution

You should go through the IBM Worklight Getting Started training materials to properly familiarize yourself with IBM Worklight.

The steps to make a Worklight project work in conjunction with MySQL are as follows.

The Database:

  1. Download and install MySQL (v5.1 or v5.5)
  2. Download the MySQL Connector/J driver and keep it at the side for now
  3. Download and install some software to interface with it. I recommend the Community edition of SQLYog.
  4. Using SQLyog, create a new Database "Worklight"
  5. Using SQLyog, create a new user "Worklight" (password "Worklight")

Worklight:

  1. Download Eclipse Java EE 4.2.2 ("Juno" SR2)
  2. Install Worklight Studio (the IBM Worklight Developer Edition Eclipse plug-in. You can search for it via Eclipse >> Help >> Marketplace >> "worklight")
  3. Create a new project
  4. In your project, place the Connector/J driver in yourProject\server\lib
  5. In your project, open the worklight.properties file located at yourProject\server\conf and search for "mysql". Uncomment the following properties. Also edit them with the database, username and password values from above:

wl.db.type=MYSQL
wl.db.url=jdbc:mysql://localhost:3306/Worklight
wl.db.username=Worklight
wl.db.password=Worklight

If you now right-click the projcet and choose "Start Worklight Server", the server should launch successfully; if not, you did something wrong. :)

If the above works for you, you can now follow the MySQL adapter training module - follow the steps, and make sure to also configure the adapter XML with the database properties as requested in page 8.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top