### Configure and Run Harness Source: https://github.com/percona/percona-xtrabackup/blob/trunk/router/src/harness/README.txt Example configuration file structure and command to start the harness. ```ini # Example configuration file [DEFAULT] logging_folder = /var/log/router config_folder = /etc/mysql/router plugin_folder = /var/lib/router runtime_folder = /var/run/router data_folder = /var/lib/router [example] library = example ``` ```bash harness /etc/mysql/harness/main.conf ``` -------------------------------- ### Install Documentation and Pkgconfig Files Source: https://github.com/percona/percona-xtrabackup/blob/trunk/extra/zlib/zlib-1.3.1/CMakeLists.txt Installs the zlib man page and pkgconfig file to their respective installation directories, provided installation is not skipped. ```cmake if(NOT SKIP_INSTALL_FILES AND NOT SKIP_INSTALL_ALL ) install(FILES zlib.3 DESTINATION "${INSTALL_MAN_DIR}/man3") endif() if(NOT SKIP_INSTALL_FILES AND NOT SKIP_INSTALL_ALL ) install(FILES ${ZLIB_PC} DESTINATION "${INSTALL_PKGCONFIG_DIR}") endif() ``` -------------------------------- ### Install the setuptools extension Source: https://github.com/percona/percona-xtrabackup/blob/trunk/extra/protobuf/protobuf-24.4/python/protobuf_distutils/README.md Commands to build and install the extension package. ```shell $ python setup.py build $ python -m pip install . ``` -------------------------------- ### Start MySQL Server with Specific Settings Source: https://github.com/percona/percona-xtrabackup/blob/trunk/mysql-test/std_data/log_corruption/README.txt Start the MySQL server using the initialized data directory. This example includes settings for fast shutdown and table name case sensitivity, along with log file size. ```bash ./bin/mysqld --datadir=/tmp/8_0_11 --innodb-fast-shutdown=0 --lower_case_table_names=1 --innodb_log_file_size=4M ``` -------------------------------- ### Install Configuration File Source: https://github.com/percona/percona-xtrabackup/blob/trunk/packaging/WiX/router/CMakeLists.txt Installs the generated sample configuration file to the etc directory. ```cmake INSTALL(FILES "${PROJECT_BINARY_DIR}/stage/${CMAKE_INSTALL_CONFIG_NAME}/etc/mysqlrouter.conf.sample" DESTINATION "etc" COMPONENT Router) ``` -------------------------------- ### Install Protobuf Library Source: https://github.com/percona/percona-xtrabackup/blob/trunk/extra/protobuf/protobuf-24.4/python/README.md Use pip to install the Protobuf library. ```bash $ pip install protobuf ``` -------------------------------- ### Install GoogleTest on *nix systems Source: https://github.com/percona/percona-xtrabackup/blob/trunk/extra/googletest/googletest-1.14.0/googletest/README.md Commands to compile and install the library to system directories. ```bash make sudo make install # Install in /usr/local/ by default ``` -------------------------------- ### Install Percona XtraBackup Source: https://github.com/percona/percona-xtrabackup/blob/trunk/storage/innobase/xtrabackup/doc/docs/installation/compiling_xtrabackup.md Install the compiled binaries to the default system location. ```bash $ sudo make install ``` -------------------------------- ### Test and Install Protobuf on Linux Source: https://github.com/percona/percona-xtrabackup/blob/trunk/extra/protobuf/protobuf-24.4/cmake/README.md Commands to run tests and install the built Protobuf binaries. ```bash ctest --verbose sudo cmake --install . ``` ```bash make VERBOSE=1 test sudo make install ``` -------------------------------- ### Start Server for Manual Connection Source: https://github.com/percona/percona-xtrabackup/blob/trunk/mysql-test/mysql-test-run.dox Use `--start` to initialize and start servers for a specific test case. This allows manual connection using the mysql client. The script terminates after server startup but monitors the server process. ```shell shell> cd mysql-test shell> ./mysql-test-run.pl --start alias & shell> ../mysql -S ./var/tmp/master.sock -h localhost -u root ``` -------------------------------- ### Install Header Files Source: https://github.com/percona/percona-xtrabackup/blob/trunk/extra/gperftools/gperftools-2.15/CMakeLists.txt Defines and installs the project header files. ```cmake set(googleinclude_HEADERS src/google/heap-checker.h src/google/heap-profiler.h src/google/malloc_extension.h src/google/malloc_extension_c.h src/google/malloc_hook.h src/google/malloc_hook_c.h src/google/profiler.h src/google/stacktrace.h src/google/tcmalloc.h ) install(FILES ${googleinclude_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/google ) ``` -------------------------------- ### Install and Verify mysqlbackup Component Source: https://github.com/percona/percona-xtrabackup/blob/trunk/storage/innobase/xtrabackup/doc/docs/advanced/page_tracking.md Commands to install the required component and verify its installation status in the MySQL component table. ```sql INSTALL COMPONENT "file://component_mysqlbackup"; ``` ```sql SELECT COUNT(1) FROM mysql.component WHERE component_urn='file://component_mysqlbackup'; ``` -------------------------------- ### Install qpress for Compressed Backups Source: https://github.com/percona/percona-xtrabackup/blob/trunk/storage/innobase/xtrabackup/doc/docs/installation/yum_repo.md Installs the qpress package required for creating compressed backups. ```bash yum install qpress ``` -------------------------------- ### Install MySQL Harness Source: https://github.com/percona/percona-xtrabackup/blob/trunk/router/src/harness/README.txt Commands to install the harness with default or custom prefixes. ```bash make install ``` ```bash cmake . -DCMAKE_INSTALL_PREFIX=~/tmp ``` -------------------------------- ### Install Protobuf via vcpkg Source: https://github.com/percona/percona-xtrabackup/blob/trunk/extra/protobuf/protobuf-24.4/src/README.md Install Protobuf and optional zlib support using vcpkg on Windows. ```bash >vcpkg install protobuf protobuf:x64-windows ``` ```bash >vcpkg install protobuf[zlib] protobuf[zlib]:x64-windows ``` -------------------------------- ### Build and Install C Extension from Source Source: https://github.com/percona/percona-xtrabackup/blob/trunk/extra/protobuf/protobuf-24.4/php/README.md Compile the C extension from the source directory and install it using PECL. ```bash cd ext/google/protobuf pear package sudo pecl install protobuf-{VERSION}.tgz ``` -------------------------------- ### Install qpress for Compression Source: https://github.com/percona/percona-xtrabackup/blob/trunk/storage/innobase/xtrabackup/doc/docs/backup_scenarios/compressed_backup.md Install the 'qpress' tool required for compressed backups. Ensure the 'tools' repository is enabled. ```bash $ sudo percona-release enable tools $ sudo apt update $ sudo apt install qpress ``` -------------------------------- ### Install Router Documentation Source: https://github.com/percona/percona-xtrabackup/blob/trunk/router/CMakeLists.txt Defines installation rules for license and readme files, excluding RPM layouts. ```cmake SET(ROUTER_LICENSE_FILE "${CMAKE_SOURCE_DIR}/router/LICENSE.router") SET(ROUTER_README_FILE "${CMAKE_SOURCE_DIR}/router/README.router") SET(DOC_DESTINATION ".") IF(NOT INSTALL_LAYOUT MATCHES "RPM") INSTALL(FILES ${ROUTER_LICENSE_FILE} ${ROUTER_README_FILE} DESTINATION ${DOC_DESTINATION} COMPONENT Router OPTIONAL) ENDIF() ``` -------------------------------- ### Install mysqlbackup Component Source: https://github.com/percona/percona-xtrabackup/blob/trunk/storage/innobase/xtrabackup/doc/source/advanced/page_tracking.md Steps to install and verify the mysqlbackup component required for page tracking. ```APIDOC ## Install mysqlbackup Component ### Description Installs and verifies the `mysqlbackup` component, which is necessary for enabling the page tracking functionality. ### Steps 1. **Install the component:** ```mysql INSTALL COMPONENT "file://component_mysqlbackup"; ``` 2. **Verify installation:** ```bash SELECT COUNT(1) FROM mysql.component WHERE component_urn='file://component_mysqlbackup'; ``` ``` -------------------------------- ### Configure Installation Rules Source: https://github.com/percona/percona-xtrabackup/blob/trunk/extra/protobuf/protobuf-24.4/third_party/utf8_range/CMakeLists.txt Defines installation paths for libraries, headers, and package configuration files. ```cmake # Configure installation. if (utf8_range_ENABLE_INSTALL) include(CMakePackageConfigHelpers) include(GNUInstallDirs) install(EXPORT ${PROJECT_NAME}-targets DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}" NAMESPACE utf8_range:: ) install(TARGETS utf8_validity utf8_range EXPORT ${PROJECT_NAME}-targets RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ) configure_package_config_file( cmake/${PROJECT_NAME}-config.cmake.in "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.cmake" INSTALL_DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}" ) install(FILES "${PROJECT_BINARY_DIR}/${PROJECT_NAME}-config.cmake" DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}" ) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/utf8_range.pc.cmake ${CMAKE_CURRENT_BINARY_DIR}/utf8_range.pc @ONLY) install( FILES ${CMAKE_CURRENT_BINARY_DIR}/utf8_range.pc DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") # Install public headers explicitly. install(FILES utf8_range.h utf8_validity.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ) endif () ``` -------------------------------- ### Install dependencies on Debian or Ubuntu Source: https://github.com/percona/percona-xtrabackup/blob/trunk/storage/innobase/xtrabackup/doc/docs/installation/compiling_xtrabackup.md Install required build tools and libraries using apt. ```bash sudo apt install bison pkg-config cmake devscripts debconf \ debhelper automake bison ca-certificates \ libcurl4-openssl-dev cmake debhelper libaio-dev \ libncurses-devlibssl-dev libtool libz-dev libgcrypt-dev libev-dev \ lsb-release python-docutils build-essential rsync \ libdbd-mysql-perl libnuma1 socat librtmp-dev libtinfo5 \ qpress liblz4-tool liblz4-1 liblz4-dev vim-common ``` ```bash $ sudo apt install python3-sphinx ``` -------------------------------- ### Add FT Example Plugin Source: https://github.com/percona/percona-xtrabackup/blob/trunk/plugin/fulltext/CMakeLists.txt Configures the build to include the FT example plugin. It is built as a module only. ```cmake MYSQL_ADD_PLUGIN(ftexample example/plugin_example.cc MODULE_ONLY MODULE_OUTPUT_NAME "mypluglib" ) ``` -------------------------------- ### Configure setup.py for Protobuf generation Source: https://github.com/percona/percona-xtrabackup/blob/trunk/extra/protobuf/protobuf-24.4/python/protobuf_distutils/README.md Example configuration for the setup.py file to include the protobuf_distutils requirement and define generation options. ```python from setuptools import setup setup( # ... name='example_project', # Require this package, but only for setup (not installation): setup_requires=['protobuf_distutils'], options={ # See below for details. 'generate_py_protobufs': { 'source_dir': 'path/to/protos', 'extra_proto_paths': ['path/to/other/project/protos'], 'output_dir': 'path/to/project/sources', # default '.' 'proto_files': ['relative/path/to/just_this_file.proto'], 'protoc': 'path/to/protoc.exe', }, }, ) ``` -------------------------------- ### ATRT Log: Test Passed Example Source: https://github.com/percona/percona-xtrabackup/blob/trunk/storage/ndb/test/run-test/ATRT_USAGE_README.txt Example log output indicating a successful test run. Shows setup, connection, process restart, and test completion with OK status. ```log 2006-03-02 15:36:51 [ndb_atrt] INFO -- Setup path not specified, using /home/ndbdev/skozlov/asetup 2006-03-02 15:36:51 [ndb_atrt] INFO -- Starting... 2006-03-02 15:36:51 [ndb_atrt] INFO -- Connecting to hosts 2006-03-02 15:36:51 [ndb_atrt] DEBUG -- Connected to node1:1234 2006-03-02 15:36:51 [ndb_atrt] DEBUG -- Connected to node2:1234 2006-03-02 15:36:51 [ndb_atrt] DEBUG -- Connected to node3:1234 2006-03-02 15:36:55 [ndb_atrt] INFO -- (Re)starting ndb processes 2006-03-02 15:37:11 [ndb_atrt] INFO -- Ndb start completed 2006-03-02 15:37:11 [ndb_atrt] INFO -- #1 - testBasic -n PkRead? T1 2006-03-02 16:37:16 [ndb_atrt] INFO -- #1 OK (0) ``` -------------------------------- ### ATRT Log: Test Failed - Process Setup Error Source: https://github.com/percona/percona-xtrabackup/blob/trunk/storage/ndb/test/run-test/ATRT_USAGE_README.txt Example log output for a test failure during process setup, even though the configuration file exists. Recommends running 'make-config.sh d.tmp'. ```log 2006-03-02 18:30:54 [ndb_atrt] INFO -- Setup path not specified, using /home/ndbdev/skozlov/asetup 2006-03-02 18:30:54 [ndb_atrt] INFO -- Starting... 2006-03-02 18:30:54 [ndb_atrt] INFO -- Connecting to hosts 2006-03-02 18:30:54 [ndb_atrt] DEBUG -- Connected to node1:1234 2006-03-02 18:30:54 [ndb_atrt] DEBUG -- Connected to node2:1234 2006-03-02 18:30:54 [ndb_atrt] DEBUG -- Connected to node3:1234 2006-03-02 18:30:58 [ndb_atrt] INFO -- (Re)starting ndb processes 2006-03-02 18:31:00 [ndb_atrt] CRITICAL -- Failed to setup process ``` -------------------------------- ### Configure CMake with Abseil Source: https://github.com/percona/percona-xtrabackup/blob/trunk/extra/protobuf/protobuf-24.4/cmake/README.md Example command to configure a project while specifying the Abseil provider and installation path. ```console C:\Path\to\build\protobuf> cmake -S. -Bcmake-out \ -DCMAKE_INSTALL_PREFIX=/tmp/protobuf \ -DCMAKE_CXX_STANDARD=14 \ -Dprotobuf_ABSL_PROVIDER=package \ -DCMAKE_PREFIX_PATH=/tmp/absl # Path to where I installed Abseil ``` -------------------------------- ### Sample Test Case Setup Source: https://github.com/percona/percona-xtrabackup/blob/trunk/mysql-test/mysql-test-run.dox This snippet demonstrates setting up a test environment by disabling warnings, setting SQL mode, and enabling warnings for subsequent operations. It's useful for controlling output during test execution. ```sql --disable_warnings DROP TABLE IF EXISTS t1; SET @@sql_mode='NO_ENGINE_SUBSTITUTION'; --enable_warnings ``` -------------------------------- ### Build and Run Instructions Source: https://github.com/percona/percona-xtrabackup/blob/trunk/extra/protobuf/protobuf-24.4/third_party/utf8_range/README.md Instructions for building the project using 'make' and running the executable with various options for benchmarking and testing. ```bash make ``` ```bash ./utf8 ``` ```bash ./utf8 bench ``` ```bash ./utf8 bench size NUM ``` ```bash ./utf8 test ``` ```bash ./utf8 bench range ``` -------------------------------- ### Start the backup container Source: https://github.com/percona/percona-xtrabackup/blob/trunk/storage/innobase/xtrabackup/doc/docs/installation/docker.md Starts the previously created backup container and attaches to its interactive shell. ```bash $ sudo docker start -ai percona-xtrabackup ``` -------------------------------- ### Determine XB_CHUNK_TYPE_PAYLOAD Size with xxd Source: https://github.com/percona/percona-xtrabackup/blob/trunk/storage/innobase/xtrabackup/doc/source/xbstream/xbstream_format.md Read 8 bytes to get the payload size. The example indicates a payload size of 10485760 bytes. ```bash # Payload size - Result 10485760 bytes $ xxd -b -l8 -s21 file.xbs 00000015: 00000000 00000000 10100000 00000000 00000000 00000000 ...... 0000001b: 00000000 00000000 ``` -------------------------------- ### Install Percona XtraBackup and dependencies Source: https://github.com/percona/percona-xtrabackup/blob/trunk/storage/innobase/xtrabackup/doc/source/installation/apt_repo.md Installs the Percona XtraBackup package and the qpress utility for compressed backups. ```bash $ sudo apt install percona-xtrabackup-80 ``` ```bash $ sudo apt install qpress ``` -------------------------------- ### Read XtraBackup Binlog Info Source: https://github.com/percona/percona-xtrabackup/blob/trunk/storage/innobase/xtrabackup/doc/source/howtos/setting_up_replication.md On the replica, review the xtrabackup_binlog_info file to get the binary log file name and position for replication setup. ```bash $ cat /var/lib/mysql/xtrabackup_binlog_info Source-bin.000001 481 ``` -------------------------------- ### Create a Client Instance Manually Source: https://github.com/percona/percona-xtrabackup/blob/trunk/extra/libcno/libcno-208939f540957a35b337dacdd5c5e34d51821bd2/README.md Demonstrates how to manually create a client instance with specified authority and scheme, useful when not using the automatic connection setup. ```python client = cno.Client(event_loop, authority='example.com', scheme='https') ``` -------------------------------- ### Clone and prepare the source repository Source: https://github.com/percona/percona-xtrabackup/blob/trunk/storage/innobase/xtrabackup/doc/docs/installation/compiling_xtrabackup.md Use these commands to download the source code and initialize submodules. ```bash $ git clone https://github.com/percona/percona-xtrabackup.git $ cd percona-xtrabackup $ git checkout 8.0 $ git submodule update --init --recursive ``` -------------------------------- ### Example Replica Status Output Source: https://github.com/percona/percona-xtrabackup/blob/trunk/storage/innobase/xtrabackup/doc/docs/howtos/setting_up_replication.md This output shows the status of the replication threads and the lag in seconds behind the source. 'Yes' for both running threads indicates successful replication setup. ```text Slave_IO_Running: Yes Slave_SQL_Running: Yes Seconds_Behind_Master: 13 ``` -------------------------------- ### Initialize Convenience Library Source: https://github.com/percona/percona-xtrabackup/blob/trunk/libmysql/CMakeLists.txt Creates the client convenience library with specified dependencies and linked libraries. ```cmake ADD_CONVENIENCE_LIBRARY(clientlib ${CLIENT_SOURCES} DEPENDENCIES GenError LINK_LIBRARIES ext::zlib OpenSSL::SSL OpenSSL::Crypto ) ``` -------------------------------- ### Curl-config Build Variables Setup Source: https://github.com/percona/percona-xtrabackup/blob/trunk/extra/curl/curl-8.9.1/CMakeLists.txt This section sets up essential variables required for the curl-config script, including compiler, version, and installation paths. It also initializes flags for shared library linking and library paths. ```cmake # curl-config needs the following options to be set. set(CC "${CMAKE_C_COMPILER}") # TODO probably put a -D... options here? set(CONFIGURE_OPTIONS "") set(CURLVERSION "${CURL_VERSION}") set(exec_prefix "\${prefix}") set(includedir "\${prefix}/include") set(LDFLAGS "${CMAKE_SHARED_LINKER_FLAGS}") set(LIBCURL_LIBS "") set(libdir "${CMAKE_INSTALL_PREFIX}/lib") ``` -------------------------------- ### Verbose Output for Error Analysis Source: https://github.com/percona/percona-xtrabackup/blob/trunk/storage/innobase/xtrabackup/doc/docs/xbcloud/xbcloud_exbackoff.md Use the --verbose flag to get detailed information about the specific error causing a failure and suggestions for configuring retriable errors. This example shows a CURL error that is not configured as retriable. ```text 210701 14:34:23 /work/pxb/ins/8.0/bin/xbcloud: Operation failed. Error: Server returned nothing (no headers, no data) 210701 14:34:23 /work/pxb/ins/8.0/bin/xbcloud: Curl error (52) Server returned nothing (no headers, no data) is not configured as retriable. You can allow it by adding --curl-retriable-errors=52 parameter ``` -------------------------------- ### Start Mock Services and Router Source: https://github.com/percona/percona-xtrabackup/blob/trunk/router/src/mock_server/src/mysql_server_mock.md Commands to initialize the metadata and data stores followed by the router process. ```bash $ ./mysql_server_mock --mysqld-port=5500 --stmt-file=./metadata-store.yaml ``` ```bash $ ./mysql_server_mock --mysqld-port=5100 --stmt-file=./group-replication.yaml ``` ```bash $ mysqlrouter --config router-conf/mysqlrouter.conf ``` -------------------------------- ### ATRT Log: Test Failed - Node Connection Error Source: https://github.com/percona/percona-xtrabackup/blob/trunk/storage/ndb/test/run-test/ATRT_USAGE_README.txt Example log output for a test failure due to inability to connect to a specific node's CPC process. Suggests starting the process manually on the affected node. ```log 2006-03-02 18:15:05 [ndb_atrt] INFO -- Setup path not specified, using /home/ndbdev/skozlov/asetup 2006-03-02 18:15:05 [ndb_atrt] INFO -- Starting... 2006-03-02 18:15:05 [ndb_atrt] INFO -- Connecting to hosts 2006-03-02 18:15:05 [ndb_atrt] DEBUG -- Connected to node1:1234 2006-03-02 18:15:05 [ndb_atrt] ERROR -- Unable to connect to cpc node2:1234 ``` -------------------------------- ### Replication Setup Source: https://context7.com/percona/percona-xtrabackup/llms.txt Clone a primary server to a replica using XtraBackup and configure replication parameters. ```bash $ xtrabackup --backup --user=root --password=secret --target-dir=/data/backup ``` ```bash $ xtrabackup --prepare --target-dir=/data/backup ``` ```bash $ rsync -avpP -e ssh /data/backup replica:/data/mysql/ ``` ```bash $ xtrabackup --move-back --target-dir=/data/mysql/backup $ chown -R mysql:mysql /var/lib/mysql ``` ```bash $ cat /var/lib/mysql/xtrabackup_binlog_info ``` ```sql mysql> CHANGE REPLICATION SOURCE TO SOURCE_HOST='source_server_ip', SOURCE_USER='repl', SOURCE_PASSWORD='repl_password', SOURCE_LOG_FILE='mysql-bin.000001', SOURCE_LOG_POS=481; mysql> START REPLICA; ``` ```sql mysql> SHOW REPLICA STATUS\G ``` ```bash $ xtrabackup --backup --slave-info --target-dir=/data/backup ``` -------------------------------- ### Create Redirect Script for Test Applications Source: https://github.com/percona/percona-xtrabackup/blob/trunk/storage/ndb/test/run-test/ATRT_SETUP_README.txt Example of a shell script used to redirect calls to applications like mysql-test-run.pl. This is useful when the application requires a specific directory or environment setup. It sets the '-x' option for debugging and changes the directory before execution. ```bash #!/bin/sh set -x cd $MYSQL_BASE_DIR/mysql-test ./mysql-test-run.pl --with-ndbcluster --ndb-connectstring=$* ``` -------------------------------- ### Install Project Targets Source: https://github.com/percona/percona-xtrabackup/blob/trunk/extra/googletest/googletest-1.14.0/googletest/CMakeLists.txt Installs the gtest and gtest_main targets as part of the project installation rules. ```cmake install_project(gtest gtest_main) ``` -------------------------------- ### Install Project Targets Source: https://github.com/percona/percona-xtrabackup/blob/trunk/extra/googletest/googletest-1.14.0/googlemock/CMakeLists.txt Installs the 'gmock' and 'gmock_main' targets as part of the project installation rules. ```cmake install_project(gmock gmock_main) ``` -------------------------------- ### Start MySQL with Performance Schema Options Source: https://github.com/percona/percona-xtrabackup/blob/trunk/storage/perfschema/unittest/conf.txt Command-line arguments for controlling performance schema state at server startup. ```bash ./mysqld --disable-performance-schema ``` ```bash ./mysqld --enable-performance-schema ``` -------------------------------- ### Add Rewrite Example Plugin Source: https://github.com/percona/percona-xtrabackup/blob/trunk/plugin/rewrite_example/CMakeLists.txt Configures the build system to include the 'rewrite_example' plugin, specifying its source file and output name. ```bash MYSQL_ADD_PLUGIN(rewrite_example rewrite_example.cc MODULE_ONLY MODULE_OUTPUT_NAME "rewrite_example" ) ``` -------------------------------- ### Wait for Replica Start Source: https://github.com/percona/percona-xtrabackup/blob/trunk/mysql-test/mysql-test-run.dox Verifies that both slave threads have successfully started after a START REPLICA command. ```mysql START REPLICA --source include/rpl/wait_for_replica_to_start.inc ``` -------------------------------- ### Install Profiler Headers Source: https://github.com/percona/percona-xtrabackup/blob/trunk/extra/gperftools/gperftools-2.15/CMakeLists.txt Installs the necessary header files for the CPU profiler and tcmalloc to the installation directory. ```cmake install(FILES ${CMAKE_CURRENT_BINARY_DIR}/gperftools/tcmalloc.h ${perftoolsinclude_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gperftools) ``` -------------------------------- ### Install Native Password Plugin Source: https://github.com/percona/percona-xtrabackup/blob/trunk/router/CMakeLists.txt Installs the mysql_native_password plugin into the plugin directory when the installation layout is set to STANDALONE. ```cmake IF(ROUTER_INSTALL_LAYOUT STREQUAL "STANDALONE") IF(TARGET mysql_native_password) ADD_DEFINITIONS(-DROUTER_CLIENT_PLUGINS_ARE_BUNDLED) # install libmysqlclient's mysql_native_password client plugin # into the Router's plugin-dir. INSTALL(TARGETS mysql_native_password RUNTIME DESTINATION ${ROUTER_INSTALL_PLUGINDIR} LIBRARY DESTINATION ${ROUTER_INSTALL_PLUGINDIR} COMPONENT Router NAMELINK_SKIP ) ENDIF() ENDIF() ``` -------------------------------- ### Enable Standard CMake Installation Option Source: https://github.com/percona/percona-xtrabackup/blob/trunk/extra/abseil/abseil-cpp-20230802.1/CMake/README.md CMake option to enable standard installation procedures for Abseil. Set to ON to allow installation. ```cmake -DABSL_ENABLE_INSTALL=ON ``` -------------------------------- ### Install Headers Source: https://github.com/percona/percona-xtrabackup/blob/trunk/extra/curl/curl-8.9.1/CMakeLists.txt Installs the header files for the libcurl library. ```cmake # install headers install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/include/curl" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} FILES_MATCHING PATTERN "*.h") ``` -------------------------------- ### Install zlib Libraries and Headers Source: https://github.com/percona/percona-xtrabackup/blob/trunk/extra/zlib/zlib-1.3.1/CMakeLists.txt Installs the zlib and zlibstatic libraries to the specified runtime, archive, and library directories. Also installs public headers to the include directory. ```cmake if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL ) install(TARGETS zlib zlibstatic RUNTIME DESTINATION "${INSTALL_BIN_DIR}" ARCHIVE DESTINATION "${INSTALL_LIB_DIR}" LIBRARY DESTINATION "${INSTALL_LIB_DIR}" ) endif() if(NOT SKIP_INSTALL_HEADERS AND NOT SKIP_INSTALL_ALL ) install(FILES ${ZLIB_PUBLIC_HDRS} DESTINATION "${INSTALL_INC_DIR}") endif() ``` -------------------------------- ### Build Example Executables Source: https://github.com/percona/percona-xtrabackup/blob/trunk/extra/zlib/zlib-1.3.1/CMakeLists.txt Compiles example and minigzip executables if ZLIB_BUILD_EXAMPLES is enabled. Links them against the zlib library and registers them as tests. ```cmake if(ZLIB_BUILD_EXAMPLES) add_executable(example test/example.c) target_link_libraries(example zlib) add_test(example example) add_executable(minigzip test/minigzip.c) target_link_libraries(minigzip zlib) if(HAVE_OFF64_T) add_executable(example64 test/example.c) target_link_libraries(example64 zlib) set_target_properties(example64 PROPERTIES COMPILE_FLAGS "-D_FILE_OFFSET_BITS=64") add_test(example64 example64) add_executable(minigzip64 test/minigzip.c) target_link_libraries(minigzip64 zlib) set_target_properties(minigzip64 PROPERTIES COMPILE_FLAGS "-D_FILE_OFFSET_BITS=64") endif() endif() ``` -------------------------------- ### Install a Plugin Source: https://github.com/percona/percona-xtrabackup/blob/trunk/mysql-test/mysql-test-run.dox Use this SQL command to install a server plugin. Ensure the plugin's shared object file is accessible. ```sql INSTALL PLUGIN test_myservice SONAME 'test_myservice.so'; ``` -------------------------------- ### Start Timer Command Source: https://github.com/percona/percona-xtrabackup/blob/trunk/mysql-test/mysql-test-run.dox The `start_timer` command restarts the internal timer, overriding any previously set start time. By default, the timer begins when mysqltest execution starts. ```APIDOC ## START_TIMER Command ### Description Restarts the timer. By default, the timer starts when mysqltest begins execution. ### Method Start Timer ### Endpoint N/A (Scripting command) ### Parameters None ### Request Example ``` start_timer; ``` ### Response N/A (Scripting command) ``` -------------------------------- ### Install Bazel on macOS Source: https://github.com/percona/percona-xtrabackup/blob/trunk/extra/protobuf/protobuf-24.4/src/README.md Install Bazel using MacPorts or Homebrew. ```bash sudo /opt/local/bin/port install bazel ``` ```bash brew install bazel ``` -------------------------------- ### Prepare a backup Source: https://github.com/percona/percona-xtrabackup/blob/trunk/storage/innobase/xtrabackup/doc/docs/xtrabackup_bin/xbk_option_reference.md Example command to apply logs to a backup located in the specified directory. ```bash $ xtrabackup --prepare --target-dir=/data/backup/mysql/ ``` -------------------------------- ### Clone and Initialize Protobuf Repository Source: https://github.com/percona/percona-xtrabackup/blob/trunk/extra/protobuf/protobuf-24.4/src/README.md Download the source code and initialize necessary submodules. ```bash git clone https://github.com/protocolbuffers/protobuf.git cd protobuf git submodule update --init --recursive ``` -------------------------------- ### Bootstrap Options for Server Initialization Source: https://github.com/percona/percona-xtrabackup/blob/trunk/mysql-test/mysql-test-run.dox Example of specifying multiple bootstrap and server options for initializing a data directory, including page size, base directory, and data directory. ```shell --exec $MYSQLD --no-defaults --initialize-insecure --lc_messages_dir=$MYSQL_SHAREDIR --innodb_page_size=8K --basedir=$MYSQLD_BASEDIR --datadir=$MYSQL_TMP_DIR/datadir1/data --init-file=$BOOTSTRAP_SQL --secure-file-priv="" ``` -------------------------------- ### Python API - Installation Source: https://github.com/percona/percona-xtrabackup/blob/trunk/extra/libcno/libcno-208939f540957a35b337dacdd5c5e34d51821bd2/README.md Instructions for installing the Python bindings for libcno. ```APIDOC ## Python API - Installation ### Prerequisites ```bash pip3 install cffi ``` ### Installation ```bash pip3 install git+https://github.com/pyos/libcno ``` ``` -------------------------------- ### Install libfido2 on macOS Source: https://github.com/percona/percona-xtrabackup/blob/trunk/extra/libfido2/libfido2-1.15.0/README.adoc Installs libfido2 using Homebrew on macOS. ```bash brew install libfido2 ``` -------------------------------- ### Build and execute benchmark commands Source: https://github.com/percona/percona-xtrabackup/blob/trunk/storage/ndb/test/crund/schema_driven_load_unfinished/tws_cpp/README.txt Commands for building the binary and running the benchmark driver. ```bash $ make dep ``` ```bash $ make opt $ make dbg ``` ```bash $ make help ``` ```bash $ make run.driver ``` ```bash $ ./TwsDriver -p ../run.properties ``` -------------------------------- ### Install Percona XtraBackup to a Non-Default Location Source: https://github.com/percona/percona-xtrabackup/blob/trunk/storage/innobase/xtrabackup/doc/source/installation/compiling_xtrabackup.md Use the DESTDIR parameter with `make install` to specify a custom installation directory. Ensure the effective user has write permissions to the chosen destination. ```bash sudo make DESTDIR= install ``` -------------------------------- ### Build and Install Google Test Source: https://github.com/percona/percona-xtrabackup/blob/trunk/extra/abseil/abseil-cpp-20230802.1/CMake/README.md Steps to build and install Google Test using CMake. Ensure Google Test is installed before configuring Abseil if using external Google Test. ```bash cmake -S /source/googletest -B /build/googletest -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/installation/dir -DBUILD_GMOCK=ON cmake --build /build/googletest --target install ``` -------------------------------- ### Initialize MySQL Datadir Source: https://github.com/percona/percona-xtrabackup/blob/trunk/mysql-test/std_data/README_tablespace_portable_linux.txt Use this command to bootstrap the datadir with a specific my.cnf configuration. Ensure the path to my.cnf and the datadir are correct for your setup. ```bash ./bin/mysqld --defaults-file=./my.cnf --datadir=../Linx-DB/ --basedir=. -u root --initialize-insecure ``` -------------------------------- ### Sample .cnf Configuration File Source: https://github.com/percona/percona-xtrabackup/blob/trunk/mysql-test/mysql-test-run.dox This sample .cnf file demonstrates how to include other configuration files and define options for different servers and the mysqltest client. It also shows how to set environment variables for test cases. ```ini !include include/default_my.cnf [mysqld.1] Options for server mysqld.1 [mysqld.2] Options for server mysqld.2 [mysqltest] ps-protocol ... ... ... [ENV] SERVER_MYPORT_1= @mysqld.1.port SERVER_MYPORT_2= @mysqld.2.port ``` -------------------------------- ### Windows Script Installation Source: https://github.com/percona/percona-xtrabackup/blob/trunk/scripts/CMakeLists.txt Configures and installs binary scripts for Windows environments. ```cmake IF(WIN32) SET(BIN_SCRIPTS mysqld_multi mysqldumpslow ) FOREACH(file ${BIN_SCRIPTS}) CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${file}.pl.in ${CMAKE_CURRENT_BINARY_DIR}/${file}.pl ESCAPE_QUOTES @ONLY ) INSTALL_SCRIPT(${CMAKE_CURRENT_BINARY_DIR}/${file}.pl COMPONENT Server_Scripts ) ENDFOREACH() ``` -------------------------------- ### Initialize CRUND Configuration Source: https://github.com/percona/percona-xtrabackup/blob/trunk/storage/ndb/test/crund/INSTALL.txt Copy sample configuration files to the local directory to begin setup. ```bash $ cp ./config_samples/* . ``` -------------------------------- ### Prepare backup with stored transition key Source: https://github.com/percona/percona-xtrabackup/blob/trunk/storage/innobase/xtrabackup/doc/docs/advanced/encrypted_innodb_tablespace_backups.md Prepare the backup using the keyring configuration. ```bash $ xtrabackup --prepare --target-dir=/data/backup \ --keyring-file-data=/var/lib/mysql-keyring/keyring ``` ```bash $ xtrabackup --prepare --target-dir=/data/backup \ --keyring-vault-config=/etc/vault.cnf ``` -------------------------------- ### Compile and install SELinux policy Source: https://github.com/percona/percona-xtrabackup/blob/trunk/storage/innobase/xtrabackup/doc/docs/security/pxb-selinux.md Commands to compile the policy module and install it into the system. ```bash $ make -f /usr/share/selinux/devel/Makefile xtrabackup.pp ``` ```bash $ semodule -i xtrabackup.pp ``` -------------------------------- ### Install Protoc Binary Source: https://github.com/percona/percona-xtrabackup/blob/trunk/extra/protobuf/protobuf-24.4/src/README.md Copy the compiled protoc binary to a system directory. ```bash cp bazel-bin/protoc /usr/local/bin ``` -------------------------------- ### Install Percona XtraBackup via Yum Source: https://github.com/percona/percona-xtrabackup/blob/trunk/storage/innobase/xtrabackup/doc/docs/installation/yum_repo.md Installs the Percona XtraBackup 8.0 package. ```bash yum install percona-xtrabackup-80 ``` -------------------------------- ### Install to Custom Location Source: https://github.com/percona/percona-xtrabackup/blob/trunk/storage/innobase/xtrabackup/doc/docs/installation/compiling_xtrabackup.md Use the DESTDIR parameter to specify a non-default installation directory. ```bash $ sudo make DESTDIR= install ``` -------------------------------- ### Prepare incremental backups Source: https://github.com/percona/percona-xtrabackup/blob/trunk/storage/innobase/xtrabackup/doc/docs/xbcloud/xbcloud.md Steps to download and apply logs for full and incremental backups. ```bash $ xbcloud get --swift-container=test_backup \ --swift-auth-version=2.0 --swift-user=admin \ --swift-tenant=admin --swift-password=xoxoxoxo \ --swift-auth-url=http://127.0.0.1:35357/ --parallel=10 \ full_backup | xbstream -xv -C /storage/downloaded_full ``` ```bash $ xtrabackup --prepare --apply-log-only --target-dir=/storage/downloaded_full ``` ```bash $ xbcloud get --swift-container=test_backup \ --swift-auth-version=2.0 --swift-user=admin \ --swift-tenant=admin --swift-password=xoxoxoxo \ --swift-auth-url=http://127.0.0.1:35357/ --parallel=10 \ inc_backup | xbstream -xv -C /storage/downloaded_inc ``` ```bash $ xtrabackup --prepare --apply-log-only \ --target-dir=/storage/downloaded_full \ --incremental-dir=/storage/downloaded_inc $ xtrabackup --prepare --target-dir=/storage/downloaded_full ``` -------------------------------- ### Connect to the database server with credentials Source: https://github.com/percona/percona-xtrabackup/blob/trunk/storage/innobase/xtrabackup/doc/docs/using_xtrabackup/privileges.md Use the --user and --password options to specify the database user credentials for backup operations. ```bash $ xtrabackup --user=DVADER --password=14MY0URF4TH3R --backup \ --target-dir=/data/bkps/ ``` -------------------------------- ### Define Installation Directory Source: https://github.com/percona/percona-xtrabackup/blob/trunk/packaging/rpm-common/CMakeLists.txt Sets the binary installation directory variable using the CMAKE_INSTALL_PREFIX. ```cmake SET(bindir "${CMAKE_INSTALL_PREFIX}/${INSTALL_BINDIR}") ``` -------------------------------- ### Install Xcode Command Line Tools Source: https://github.com/percona/percona-xtrabackup/blob/trunk/extra/protobuf/protobuf-24.4/src/README.md Install required Unix tools on macOS. ```bash sudo xcode-select --install ``` -------------------------------- ### Create a Full Backup with XtraBackup Source: https://github.com/percona/percona-xtrabackup/blob/trunk/storage/innobase/xtrabackup/doc/docs/backup_scenarios/full_backup.md Use this command to initiate a full backup. Specify the target directory where backup files will be stored. The directory will be created if it doesn't exist. ```bash $ xtrabackup --backup --target-dir=/data/backups/ ``` -------------------------------- ### Install CNO Python Bindings Source: https://github.com/percona/percona-xtrabackup/blob/trunk/extra/libcno/libcno-208939f540957a35b337dacdd5c5e34d51821bd2/README.md Commands to install CFFI and the CNO Python package. ```bash pip3 install cffi pip3 install git+https://github.com/pyos/libcno ``` -------------------------------- ### Install libfido2 on Ubuntu Source: https://github.com/percona/percona-xtrabackup/blob/trunk/extra/libfido2/libfido2-1.15.0/README.adoc Installs libfido2 and development files on Ubuntu 22.04 and 20.04. ```bash sudo apt install libfido2-1 libfido2-dev libfido2-doc fido2-tools ```