Creating the Jamf Pro Database Using the Jamf Pro Server Tools Command-Line Interface
This article explains how to create the Jamf Pro database using the Jamf Pro Server Tools Command-Line Interface. The Jamf Pro web application requires the Jamf Pro database for storing its data and credentials for a user that has full access to that database.
MySQL is the database subsystem used by Jamf Pro. MySQL can be a local instance, residing on the same server as Jamf Pro, or MySQL can reside on a different server. While there are various methods for connecting to MySQL to perform the following tasks, the process described here is for connecting locally to the mysql command line on the same server on which MySQL is installed.
MySQL should already be installed and running on the target server. For more information, see the Installing Java and MySQL Knowledge Base article.
Creating the Jamf Pro database involves the following steps:
- Create the Jamf Pro database and user
- Configure MySQL
- Start Up Jamf Pro
Step 1. Create the Jamf Pro Database and User
- Execute the following command from a terminal or command prompt:
jamf-pro database init
- When prompted, enter your MySQL root password.
Note: If you had previously used a temporary root password, an option will appear to set the root password. Press Enter to skip this option.
- Enter the name for Jamf Pro database that you want to use (for example, “jamfsoftware").
- Enter the username for the database. If you enter a new username, it will be created.
- Enter a new, strong user password.
Note: If you forget to enter the password, you can run the CLI again. When you enter the old username, the password will be reset.
- A database connection test will run. Press "Y" if you want to save the username and password to the configuration file.
- To view the completed list of settings, execute the following command:
jamf-pro config list
Step 2. Configure MySQL
- Set the value of the innodb_buffer_pool_size to an appropriate value for your server by executing the following command:
The <size> value is the total amount of memory that MySQL will use on the server. This should be approximately 70% of the server's total available memory. At a minimum, a value larger than the largest table size in the database is recommended. Table sizes will vary based on the number of enrolled devices and log flushing frequency. The value for this variable uses a single character to specify the unit of measure for the numeric value. Decimal values are not supported. For example:
jamf-pro database config set --innodb-buffer-pool-size <size>
- "16G" is equal to 16 Gigabytes
- "4096M" is equal to 4096 Megabytes or 4 Gigabytes.
Note: Ensure that enough memory is left available for the operating system of the server. Different operating systems have different memory requirements.
- Set the innodb_file_per_table value to 1 by executing the following command:
jamf-pro database config set --innodb-file-per-table 1
- Execute the following command to restart MySQL:
jamf-pro database restart
Step 3. Start Up Jamf Pro
After installing Jamf Pro on the server, your first navigation to the Jamf Pro web application should display the "Database Connection Error" dialog.
Click the Edit Connection button and change any of the default information to the custom values that you used during the creation of the Jamf Pro database and database access user. This should, at least, include the password.
Note: You can avoid this step on staging and testing servers by using the database name, username, and password that you had defined earlier (e.g., jamfsoftware, jamfsoftware@localhost, and jamfsw03). However, these examples should not be used for production systems containing user data.
Warning: Be especially cognizant of the need to use secure credentials to meet GDPR regulations if you are doing things like restoring a production database backup to a "testing" Jamf Pro instance.
For instructions on creating the Jamf Pro database manually, see the Manually Creating the Jamf Pro Database Knowledge Base article.