DataSunrise Achieves AWS DevOps Competency Status in AWS DevSecOps and Monitoring, Logging, Performance

Percona Server for MySQL Database Activity History

Percona Server for MySQL Database Activity History

Introduction

Tracking database activity is crucial for optimizing performance, enhancing security, and ensuring compliance. Percona Server for MySQL Database Activity History provides a powerful method to monitor and analyze database events effectively. This feature offers valuable insights into query execution, user interactions, and overall system performance, helping organizations improve observability and make data-driven decisions.

In this guide, we will explore the benefits, setup process, and best practices for leveraging Percona Server for MySQL Database Activity History efficiently.

Setting Up Percona Server for MySQL Database Activity History

To start monitoring database activity, we need a solid foundation. Percona Monitoring & Management (PMM) serves as an excellent solution for database management and activity tracking. One of the easiest ways to deploy this setup is by using Docker Compose, which simplifies containerized environments.

Docker Compose Configuration

For effective activity monitoring, both Percona Server for MySQL and PMM should be in the same network. Below is a working Docker Compose configuration:

version: "3.8"

services:
  percona-mysql:
    image: percona/percona-server:8.0
    container_name: percona-mysql
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: rootpass
    ports:
      - "13306:3306"
    networks:
      - pmm-net

  pmm-server:
    image: percona/pmm-server:latest
    container_name: pmm-server
    restart: always
    ports:
      - "12443:8443"
    networks:
      - pmm-net

networks:
  pmm-net:
    driver: bridge

Running the Setup

Save this configuration in a docker-compose.yml file and run the following command:

docker compose up -d

This will launch both Percona MySQL and PMM in the same internal network (pmm-net). Next, we need to establish a connection between them.

Connecting Percona Server to PMM

First, list all networks in Docker:

docker network ls

You should see output similar to:

NETWORK ID     NAME                                  DRIVER    SCOPE
3871d927f35b   pmm-mysql_pmm-net                     bridge    local
f53bdb7ddf08   host                                  host      local
c01f889de681   none                                  null      local

Identify the correct network (pmm-mysql_pmm-net in this case) and retrieve the IP address of the Percona MySQL container:

docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' percona-mysql

Now, add the Percona instance at this address via PMM’s GUI:

PMM GUI Connection

Note: Use the internal port of your Percona Server instance, as connections operate within the container’s network.

Enhancing Security with DataSunrise

While PMM provides a robust monitoring solution, providing robust security for the database environment is equally important. DataSunrise, a database security and auditing solution, can complement PMM by acting as a database proxy. This setup allows for flexible security management.

Integrating DataSunrise with Percona Server

To include DataSunrise in the setup, modify the Docker Compose configuration as follows:

version: "3.8"

services:
  percona-mysql:
    image: percona/percona-server:latest
    container_name: percona-mysql
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: rootpass
    ports:
      - "13306:3306"
    networks:
      - pmm-net

  pmm-server:
    image: percona/pmm-server:latest
    container_name: pmm-server
    restart: always
    ports:
      - "12080:8080"
      - "12443:8443"
    networks:
      - pmm-net

  datasunrise:
    image: datasunrise/datasunrise:latest
    container_name: ds-server
    restart: always
    ports:
      - "11000:11000"
      - "23306:23306"
    networks:
      - pmm-net

networks:
  pmm-net:
    driver: bridge

Run the updated setup:

docker compose up -d

Configuring the DataSunrise Proxy

Since DataSunrise acts as a database proxy, it must sit between PMM and Percona Server. If you restarted the containers, recheck their IP addresses:

docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' percona-mysql

Then, add Percona Server to DataSunrise using its GUI:

Adding Percona Server to DataSunrise

Finally, reconfigure PMM to use DataSunrise as its Percona connection:

Connecting DataSunrise to PMM

With this setup, you can effectively monitor database activity while securing your environment through the DataSunrise proxy.

Conclusion & Best Practices

To maximize the effectiveness of Percona Server for MySQL Database Activity History, consider the following best practices:

  1. Regularly Monitor Logs – Continuously review logs to identify anomalies and performance bottlenecks.
  2. Use PMM Alerts – Configure alerts to notify you of unusual database activity.
  3. Enhance Security with DataSunrise – Implement database security policies and access controls.
  4. Optimize Query Performance – Analyze slow queries and optimize them for efficiency.
  5. Maintain Regular Backups – Ensure data integrity with scheduled backups.
Best-case setup with Percona Server for MySQL, PMM and DataSunrise

By following these steps, you can maintain a well-monitored and secure database environment with Percona Server for MySQL and complementary tools like PMM and DataSunrise.

Next

Data Audit for Cloudberry

Data Audit for Cloudberry

Learn More

Need Our Support Team Help?

Our experts will be glad to answer your questions.

Countryx
United States
United Kingdom
France
Germany
Australia
Afghanistan
Islands
Albania
Algeria
American Samoa
Andorra
Angola
Anguilla
Antarctica
Antigua and Barbuda
Argentina
Armenia
Aruba
Austria
Azerbaijan
Bahamas
Bahrain
Bangladesh
Barbados
Belarus
Belgium
Belize
Benin
Bermuda
Bhutan
Bolivia
Bosnia and Herzegovina
Botswana
Bouvet
Brazil
British Indian Ocean Territory
Brunei Darussalam
Bulgaria
Burkina Faso
Burundi
Cambodia
Cameroon
Canada
Cape Verde
Cayman Islands
Central African Republic
Chad
Chile
China
Christmas Island
Cocos (Keeling) Islands
Colombia
Comoros
Congo, Republic of the
Congo, The Democratic Republic of the
Cook Islands
Costa Rica
Cote D'Ivoire
Croatia
Cuba
Cyprus
Czech Republic
Denmark
Djibouti
Dominica
Dominican Republic
Ecuador
Egypt
El Salvador
Equatorial Guinea
Eritrea
Estonia
Ethiopia
Falkland Islands (Malvinas)
Faroe Islands
Fiji
Finland
French Guiana
French Polynesia
French Southern Territories
Gabon
Gambia
Georgia
Ghana
Gibraltar
Greece
Greenland
Grenada
Guadeloupe
Guam
Guatemala
Guernsey
Guinea
Guinea-Bissau
Guyana
Haiti
Heard Island and Mcdonald Islands
Holy See (Vatican City State)
Honduras
Hong Kong
Hungary
Iceland
India
Indonesia
Iran, Islamic Republic Of
Iraq
Ireland
Isle of Man
Israel
Italy
Jamaica
Japan
Jersey
Jordan
Kazakhstan
Kenya
Kiribati
Korea, Democratic People's Republic of
Korea, Republic of
Kuwait
Kyrgyzstan
Lao People's Democratic Republic
Latvia
Lebanon
Lesotho
Liberia
Libyan Arab Jamahiriya
Liechtenstein
Lithuania
Luxembourg
Macao
Madagascar
Malawi
Malaysia
Maldives
Mali
Malta
Marshall Islands
Martinique
Mauritania
Mauritius
Mayotte
Mexico
Micronesia, Federated States of
Moldova, Republic of
Monaco
Mongolia
Montserrat
Morocco
Mozambique
Myanmar
Namibia
Nauru
Nepal
Netherlands
Netherlands Antilles
New Caledonia
New Zealand
Nicaragua
Niger
Nigeria
Niue
Norfolk Island
North Macedonia, Republic of
Northern Mariana Islands
Norway
Oman
Pakistan
Palau
Palestinian Territory, Occupied
Panama
Papua New Guinea
Paraguay
Peru
Philippines
Pitcairn
Poland
Portugal
Puerto Rico
Qatar
Reunion
Romania
Russian Federation
Rwanda
Saint Helena
Saint Kitts and Nevis
Saint Lucia
Saint Pierre and Miquelon
Saint Vincent and the Grenadines
Samoa
San Marino
Sao Tome and Principe
Saudi Arabia
Senegal
Serbia and Montenegro
Seychelles
Sierra Leone
Singapore
Slovakia
Slovenia
Solomon Islands
Somalia
South Africa
South Georgia and the South Sandwich Islands
Spain
Sri Lanka
Sudan
Suriname
Svalbard and Jan Mayen
Swaziland
Sweden
Switzerland
Syrian Arab Republic
Taiwan, Province of China
Tajikistan
Tanzania, United Republic of
Thailand
Timor-Leste
Togo
Tokelau
Tonga
Trinidad and Tobago
Tunisia
Turkey
Turkmenistan
Turks and Caicos Islands
Tuvalu
Uganda
Ukraine
United Arab Emirates
United States Minor Outlying Islands
Uruguay
Uzbekistan
Vanuatu
Venezuela
Viet Nam
Virgin Islands, British
Virgin Islands, U.S.
Wallis and Futuna
Western Sahara
Yemen
Zambia
Zimbabwe
Choose a topicx
General Information
Sales
Customer Service and Technical Support
Partnership and Alliance Inquiries
General information:
info@datasunrise.com
Customer Service and Technical Support:
support.datasunrise.com
Partnership and Alliance Inquiries:
partner@datasunrise.com