How to access the database for your Fisikal instance

How to make queries on the MySQL database behind your Fisikal instance.

If your company owns their own Fisikal instance then, since you own all the data, you may request direct read-only MySQL access to the database.

Querying the database allows your team to:

  • Generate your own lists of data in forms that are not available in the Fisikal UI
  • Allow Fisikal data to be extracted into a Business Intelligence (BI) tool for analysis
  • Automate the retrieval of certain data for use in a workflow

Database access is possible on the shared CuttingEdge instance too under certain conditions and with restrictions. Please contact your account manager to discuss.


  • Access to the database is read-only. We will not allow write access to the data.
  • Running a complex or large report can have a performance impact on the Fisikal instance for other users. Consider performance when writing and running queries, and consider the timing of the query on the business.
  • Consider whether the data you require is already available in the built-in reports in Fisikal. That is usually a significantly simpler method.
  • Your private client information is available through this route in bulk. Consider where the data will go when it is extracted from Fisikal. It is secure in the database, but once it is in a CSV file and downloaded to a personal computer then the data is outside the security perimeter. 
  • Do not share the credentials widely.


IP address whitelisting

Access to the Fisikal database is granted using an IP address whitelist. You must supply the static IP address of the location from where queries will be made.

Make this request to your Fisikal account manager.

In return you will receive confirmation that the IP address has been whitelisted for your instance, and the credentials required for access.

Database querying software

For ad hoc queries you will need  a SQL querying tool.

For example:

  • MySQL Workbench
  • JetBrains DataGrip
  • dbForge Studio for MySQL
  • Retool

Use the credentials provided in your selected tool to connect to the MySQL database.


Database documentation

The database for Fisikal involves 100s of tables and joins.

There is no practical database diagram available (we've tried but it is too big to be useful).

There is no ongoing database documentation to complement the database itself.

Instead the database has been designed with industry standard practices to be recognisable and explorable by a mildly wise database technician.

Please do ask for assistance from your account manager if you have questions.

Useful queries

Details of a client:

if(u.disabled, 'Inactive', 'Active') as 'status',
u.alt_id, as 'home_location_name',
from users u
left join location_users lu on = lu.user_id and lu.`default` = true
left join locations l on = lu.location_id
where = 1234


Details of an event in the schedule:

select, as 'service_title', as 'activity', as 'category',
o.occurs_at, as 'location', as 'trainer_name',
count( as 'clients_booked',
if(s.use_activity_schedule_colors, ac.schedule_color_header,
s.schedule_color_header) as 'header_colour'
from appointments a
join occurrences o on = o.appointment_id
join trainer_activities ta on a.trainer_activity_id =
join services s on = ta.service_id
join service_titles st on s.service_title_id =
join activity_categories ac on s.activity_category_id =
join service_categories sc on s.service_category_id =
join locations l on ta.location_id =
join users u on = ta.trainer_id
join occurrence_clients oc on = oc.occurrence_id and oc.is_cancelled = false
where = 123


List of Packages assigned to a client:

select                                   as 'client_id',, as 'csp_id', as 'service_package_name',
if(csp.disabled, 'Inactive', 'Active') as 'csp_status',
if(csp.is_expired, 'Expired', '') as 'is_expired',
if(csp.refunded, 'Refunded', '') as 'is_refunded',
if(csp.archived, 'Archived', '') as 'is_archived',
c.total_amount as 'total_credits_remaining'
from client_service_packages csp
join service_packages sp on csp.service_package_id =
join users u on = csp.client_id
left join (select c.client_service_package_id, sum(amount) as 'total_amount'
from credits c
group by c.client_service_package_id) c on c.client_service_package_id =
where = 12345