As of December 31st, 2023 ThreadFix 2.X has reached End of Life and is no longer supported. For any further information please contact the Success and Implementation team.

CentOS MySQL Installation and Configuration

You will learn

How to install and configure MySQL on CentOS.

Prerequisites

Audience: IT Professional and/or End User
Difficulty: Intermediate
Time needed: Approximately 60 minutes
Tools required: N/A

Install MySQL (Highly Recommended)

ThreadFix currently supports MySQL versions 5.6 and 5.7. It is not yet compatible with version 8.

(Even though the repository available at https://dev.mysql.com/downloads/repo/yum/ is newer and defaults to installing version 8, you can still install 5.7 as follows.)

1. Enable the MySQL 5.7 Yum repository:

sudo rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022 sudo yum localinstall https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm

 

2. Install MySQL server:

sudo yum install mysql-community-server

Options for Large Data Sets

1. To help the MySQL server to work with large data sets, we recommend allocating more than the 8GB of memory stated in our hardware requirements for the DB server.

Additionally, edit the my.cnf file (e.g., /etc/my.cnf), adding the following lines under the "[mysqld]" header (or editing the existing values, if already present):

innodb_buffer_pool_size=12G tmp_table_size=6G max_heap_table_size=6G max_allowed_packet=1G

2. Restart the server for the changes to take effect.

You can confirm the changes afterward with the following query (unit=GB):

Start MySQL

1. Start & enable the MySQL daemon:

2. Verify successful start:

The output should contain Active: active (running), and the last line should end with Started MySQL Server.

3. To start the MySQL command-line-interface, you'll need the temporary password generated for the MySQL root user, which you can find in /var/log/mysqld.log.

Example search and output:
Temporary MySQL Root User Password

4. Run the following security script:
MySQL Security Script

5. Enter the default root password obtained in the previous step and enter & re-enter a new password when prompted.

You'll then be asked if you want to change the root password (again)...press ENTER to decline and step through the remaining prompts...we recommend choosing Yes for removing anonymous users and for reloading the privilege tables at the end.

6. Start up the MySQL command-line-interface by running the following:
MySQL CLI

Use the new root password you created in the previous step.

Create ThreadFix Database and Accounts

1. Update MySQL Character Set and Create the threadfix database:

  • MySQL does not, by default, support the full Unicode character set. ThreadFix requires the MySQL character set to be updated to utf8mb4. Running the following command will create the threadfix database and set the correct encoding:

2. Create user accounts by using the following commands:
Create & Grant ThreadFix Accounts:

Change 'threadfix' and 'tfpass' to a more secure username and password

More information on creating users and their permissions in MySQL can be found here.

After you have finished creating a new user, or at any time, use the EXIT command to exit the MySQL command-line-interface.

ThreadFix Installation

Now that you've completed the CentOS Enterprise Setup and MySQL Installation and Configuration, proceed to the ThreadFix Installation page.

www.threadfix.it | www.coalfire.com
Copyright © 2024 Coalfire. All rights reserved.

This Information Security Policy is CoalFire - Public: Distribution of this material is not limited.