how to access the database for Jira Service Management
You do not. You have no access to the database behind the service on Cloud.
You wouldn't want to either, the database is absolutely not designed for reporting and SQL is the worst possible way to try to report off a Jira data set.
In addition to @Nic Brough -Adaptavist- 's answer, if you need access to the "raw" data, look at the REST API which you can also use (if for reporting) with most BI tools.
It looks like you're new here. Sign in or register to get started.