Skip to content

Latest commit

 

History

History
105 lines (69 loc) · 2.39 KB

dev.adoc

File metadata and controls

105 lines (69 loc) · 2.39 KB

Developer guide

Setting the database

Install Mysql

Get community server (5.7.36 version):
https://dev.mysql.com/downloads/mysql/5.7.html

Configure local data

Copy and update 'my_config.ini' file in mysql using the sibling file.
In Administrator CMD, run:

bin\mysqld --defaults-file=my-config.ini --initialize-insecure

This command creates a server with 'root' account and no password (~= insecure).

Starting DB

To start the mysql database if not installed as a service. (or copy and use "start-server.bat" in installation)

bin\mysqld --defaults-file=my-config.ini --console

To start client:

bin\mysql -u root --skip-password
Note

You can change root password with:

ALTER USER 'root'@'localhost' IDENTIFIED BY 'new-root-password';

But it is useless for developer.

Create schema

Use in mysql client: /misc/sql/createDatabase.sql

bin\mysql -u root --skip-password < %git_home%\Activity-Manager\misc\sql\createDatabase.sql

Create a connection in 'Data Source Explorer' from
/org.activitymgr.ui.web.feature/cfg-db.properties

Stopping DB

The proper way to stop is to call this command.

bin\mysqladmin -u root shutdown

Using console "Close" may break a transaction.

Configure Db client with Eclipse

Get Eclipse instance from Oomph

Use /misc/oomph/org.eclipse.setup to get all plugins.

Import a connection

In 'Data Source Explorer' view ('Database development' perspective), import /misc/doc/eclipse_connection.xml.

Declare MySQL driver

Importing a connection also declare the driver but JAR file is absolute.

Driver is placed at /misc/sql/mysql-connector-java-8.0.27.jar, mirror of: https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-8.0.27.zip

In Windows/Preference#Data manager/Connectivity/Driver definition:+ Correct 'MySQL JDBC Driver' with provided JAR if needed.

Initialize database structure

bin\mysql --user=taskmgr --password=taskmgr taskmgr_db < %git_home%\Activity-Manager\misc\sql\createTables.sql

or use eclipse connection with misc/sql/createTables.sql.