[KB8595] Install MySQL 5 for ESET INSPECT server on Linux system

Issue

Solution

Install MySQL 5

  1. Open the Terminal and run the following commands:

    sudo apt-get update
    
    sudo apt-get upgrade
    
    sudo apt-get install mysql-server-5.7
  2. Install MySQL Workbench, which is the database GUI:

    sudo apt install mysql-workbench

Database setup

  1. Set up the database user for localhost and external connections and push the following SQL commands in Command line (not Workbench): 

    sudo mysql -u root -p
    
    create user 'root'@'%' IDENTIFIED BY 'root';
    
    ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'admin.1';
    
    ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'admin.1';
    
    grant all privileges on *.* to 'root'@'%' with grant option;
  2. From the mysql.user menu, select host %, and user root.

  3. After the user is added and defined, set up the MySQL database.

    mysql_secure_installation
    
    Validate password component [Y/n] n
    
    Change the root password? [Y/n] n
    
    Remove anonymous users? [Y/n] y
    
    Disallow root login remotely? [Y/n] n
    
    Remove test database and access to it? [Y/n] y
    
    Reload privilege tables now? [Y/n] y
  4. We recommend changing the password from the default admin.1. The password is required during the ESET Inspect Server install.

  5. Set the password through the Terminal.

  6. In the Workbench, click DatabaseConnect to Database. Select the database and click OK.

  7. Click ServerUsers and Privileges. Select root%. Set and confirm the password.

  8. Open the Terminal and execute the following command to copy the mysql.service file:

    sudo cp /lib/systemd/system/mysql.service /etc/systemd/system/
  9. Open /etc/systemd/system/mysql.service in a text editor and add the following lines:

    sudo nano /etc/systemd/system/mysql.service
    
    LimitNOFILE=30000
    
    LimitMEMLOCK=30000
  10. Save the file and reload the system configuration by the following command:

    sudo systemctl daemon-reload
  11. Modify the /etc/mysql/mysql.conf.d/mysqld.cnf file (where the db params). Open the file in a text editor and add the following lines under section [mysqld].

    *bind-address – default value is 127.0.0.1. Set the address to the machine's IP where MySQL is running. The ESET Inspect On-Prem install cannot connect to MySQL if the IP is incorrect.

    sudo /etc/mysql/mysql.conf.d/mysqld.cnf
    
    bind-address = IP_OF_THIS_MACHINE, BUT NO 127.0.0.1
    
    thread_stack = 256K
  12. Insert the following parameters into InnoDB.

    *innodb_buffer_pool_size—set to 80% of the RAM size of MySQL machine
    *innodb_log_file_size —set to 40% - 60% of the innodb_buffer_pool_size value

    innodb_buffer_pool_size=4G
    
    innodb_flush_log_at_trx_commit=0
    
    innodb_log_file_size=2G
  13. Add to the end the following lines:

    event_scheduler = ON
    
    wait_timeout=900
    
    max_connections=300
  14. Restart MySQL to load the new parameters:

    sudo service mysql restart

Verify MySQL Service status

  1. On the terminal, type the following command:

    systemctl status mysql.service
  2. MySQL Service is running when the reported state is: active (running).


Sources