### Stages of Session Setup - Negotiation Source: https://github.com/mysql/mysql-server/blob/trunk/plugin/x/protocol/doc/mysqlx-protocol-lifecycle.dox Example of the negotiation phase in session setup, where the client requests server capabilities and the server responds. ```uml @startuml "Stages of Session Setup" == Negotiation == Client -> Server: CapabilitiesGet() Server --> Client: { "tls": 0, ... } Client -> Server: CapabilitiesSet({"tls" : 1}) Server --> Client: Ok == Authentication == Client -> Server: AuthenticateStart(mech="MYSQL41", ...) Server --> Client: AuthenticateContinue(auth_data="...") Client -> Server: AuthenticateContinue(auth_data="...") Server --> Client: AuthenticateOk() == Commands == ... @enduml ``` -------------------------------- ### Install Sample Configuration File Source: https://github.com/mysql/mysql-server/blob/trunk/router/src/router/CMakeLists.txt Installs a sample configuration file to the documentation directory if ROUTER_INSTALL_DOCDIR is defined. This is part of the Router component installation. ```cmake IF(ROUTER_INSTALL_DOCDIR) INSTALL(FILES ${PROJECT_SOURCE_DIR}/doc/sample_mysqlrouter.conf DESTINATION ${ROUTER_INSTALL_DOCDIR} COMPONENT Router) # we do not install the README, License and so on as we # are part of the server-tree ENDIF() ``` -------------------------------- ### Install Prerequisites Source: https://github.com/mysql/mysql-server/blob/trunk/extra/json/json-3.12.0/tools/serve_header/README.md Install the required Python packages for serve_header.py. Ensure PyYAML and watchdog are installed. ```bash PyYAML watchdog ``` -------------------------------- ### Windows Command Prompt Environment Setup Source: https://github.com/mysql/mysql-server/blob/trunk/extra/protobuf/protobuf-24.4/cmake/README.md Commands for navigating directories, creating installation folders, and updating the system PATH for required tools. ```batch C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional> ``` ```batch C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional>cd C:\Path\to C:\Path\to> ``` ```batch C:\Path\to>mkdir install ``` ```batch C:\Path\to>set PATH=%PATH%;C:\Program Files (x86)\CMake\bin ``` ```batch C:\Path\to>set PATH=%PATH%;C:\Program Files\Git\cmd ``` ```batch C:\Path\to>set PATH=%PATH%;C:\tools\ninja ``` -------------------------------- ### Install Router License and Readme Files Source: https://github.com/mysql/mysql-server/blob/trunk/router/CMakeLists.txt Installs the LICENSE.router and README.router files to the documentation directory, unless the installation layout is RPM. ```cmake INSTALL(FILES ${ROUTER_LICENSE_FILE} ${ROUTER_README_FILE} DESTINATION ${DOC_DESTINATION} COMPONENT Router OPTIONAL) ``` -------------------------------- ### Install Zlib Documentation and License Files Source: https://github.com/mysql/mysql-server/blob/trunk/extra/zlib/zlib-1.3.2/CMakeLists.txt Installs various documentation files, including algorithm details, RFCs, and a text vs. binary guide, along with the LICENSE file, as part of the Docs component. ```cmake install( FILES LICENSE doc/algorithm.txt doc/crc-doc.1.0.pdf doc/rfc1950.txt doc/rfc1951.txt doc/rfc1952.txt doc/txtvsbin.txt COMPONENT Docs DESTINATION "${CMAKE_INSTALL_DOCDIR}/zlib") ``` -------------------------------- ### Custom Install Prefix Source: https://github.com/mysql/mysql-server/blob/trunk/router/src/harness/README.txt Example of setting a custom installation prefix for the MySQL Harness build using CMake. ```bash cmake . -DCMAKE_INSTALL_PREFIX=~/tmp ``` -------------------------------- ### Configure Installation Source: https://github.com/mysql/mysql-server/blob/trunk/extra/protobuf/protobuf-24.4/third_party/utf8_range/CMakeLists.txt Sets up installation rules if utf8_range_ENABLE_INSTALL is ON. This includes installing libraries, headers, and package configuration files. ```cmake 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 "${CMAKE_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 () ``` -------------------------------- ### Run an Example with Bazel Source: https://github.com/mysql/mysql-server/blob/trunk/extra/opentelemetry-cpp/opentelemetry-cpp-1.23.0/CONTRIBUTING.md Executes a previously built example from the opentelemetry-cpp project. Ensure the example has been built first using the 'bazel build' command. ```shell bazel-bin/examples// ``` -------------------------------- ### Adding the Example Storage Engine Plugin Source: https://github.com/mysql/mysql-server/blob/trunk/storage/example/CMakeLists.txt Configures the example storage engine plugin. Use this when building the example storage engine as a default or module. ```cmake DISABLE_MISSING_PROFILE_WARNING() ADD_DEFINITIONS(-DMYSQL_SERVER) IF(WITH_EXAMPLE_STORAGE_ENGINE AND NOT WITHOUT_EXAMPLE_STORAGE_ENGINE) MYSQL_ADD_PLUGIN(example ha_example.cc STORAGE_ENGINE DEFAULT LINK_LIBRARIES ext::zlib ) ELSEIF(NOT WITHOUT_EXAMPLE_STORAGE_ENGINE) MYSQL_ADD_PLUGIN(example ha_example.cc STORAGE_ENGINE MODULE_ONLY LINK_LIBRARIES ext::zlib ) ENDIF() ``` -------------------------------- ### Build an Example with Bazel Source: https://github.com/mysql/mysql-server/blob/trunk/extra/opentelemetry-cpp/opentelemetry-cpp-1.23.0/CONTRIBUTING.md Builds a specific example from the opentelemetry-cpp project using Bazel. Replace placeholders with your example's directory and binary name. ```shell bazel build //examples/: ``` -------------------------------- ### Build and Install C Extension from Source Source: https://github.com/mysql/mysql-server/blob/trunk/extra/protobuf/protobuf-24.4/php/README.md Compile the extension from the source directory and install the resulting package. ```bash cd ext/google/protobuf pear package sudo pecl install protobuf-{VERSION}.tgz ``` -------------------------------- ### Start MySQL Server Source: https://github.com/mysql/mysql-server/blob/trunk/mysql-test/std_data/README_tablespace_portable_linux.txt Command to start the MySQL server instance using the defined configuration. ```bash ./bin/mysqld --defaults-file=./my.cnf --datadir=../Linx-DB/ --basedir=. -u root ``` -------------------------------- ### Start MySQL Server for Data Directory Preparation Source: https://github.com/mysql/mysql-server/blob/trunk/mysql-test/std_data/log_corruption/README.txt Commands to start the server on the initialized directory. ```bash ./bin/mysqld --datadir=/tmp/8_0_11 --innodb-fast-shutdown=0 --lower_case_table_names=1 --innodb_log_file_size=4M ``` ```bash ./sql/mysqld --datadir=/tmp/5_7_9 --innodb-fast-shutdown=0 --lower_case_table_names=1 --innodb_log_file_size=4M --lc-messages-dir=./sql/share/english ``` -------------------------------- ### Test and Install Protobuf on Linux Source: https://github.com/mysql/mysql-server/blob/trunk/extra/protobuf/protobuf-24.4/cmake/README.md Commands to verify and install the built Protobuf libraries. ```bash ctest --verbose sudo cmake --install . ``` ```bash make VERBOSE=1 test sudo make install ``` -------------------------------- ### Install Documentation and Readme Files Source: https://github.com/mysql/mysql-server/blob/trunk/CMakeLists.txt Installs README and LICENSE files to the Readme component directory and documentation info files to the Info component directory, unless the installation layout is RPM. ```cmake IF(NOT INSTALL_LAYOUT MATCHES "RPM") INSTALL(FILES README LICENSE DESTINATION ${INSTALL_DOCREADMEDIR} COMPONENT Readme) INSTALL(FILES ${CMAKE_BINARY_DIR}/Docs/INFO_SRC ${CMAKE_BINARY_DIR}/Docs/INFO_BIN DESTINATION ${INSTALL_DOCDIR} COMPONENT Info ) # MYSQL_DOCS_LOCATON is used in "make dist", # points to the documentation directory SET(MYSQL_DOCS_LOCATION "" CACHE PATH "Location from where documentation is copied") MARK_AS_ADVANCED(MYSQL_DOCS_LOCATION) ENDIF() ``` -------------------------------- ### Install Protobuf via vcpkg on Windows Source: https://github.com/mysql/mysql-server/blob/trunk/extra/protobuf/protobuf-24.4/src/README.md Use vcpkg to install Protobuf and optional zlib support. ```bash >vcpkg install protobuf protobuf:x64-windows ``` ```bash >vcpkg install protobuf[zlib] protobuf[zlib]:x64-windows ``` -------------------------------- ### Include Examples CMake Module Source: https://github.com/mysql/mysql-server/blob/trunk/extra/protobuf/protobuf-24.4/CMakeLists.txt Includes the CMake module for building Protocol Buffers examples if the build is configured to include examples. ```cmake if (protobuf_BUILD_EXAMPLES) include(${protobuf_SOURCE_DIR}/cmake/examples.cmake) endif (protobuf_BUILD_EXAMPLES) ``` -------------------------------- ### Configure HTML Installation Source: https://github.com/mysql/mysql-server/blob/trunk/extra/libfido2/libfido2-1.15.0/man/CMakeLists.txt Installs HTML manual pages and style sheets if MANDOC_PATH is defined. ```cmake if(MANDOC_PATH) add_dependencies(man man_symlink_html) add_dependencies(man_gzip man_lint) install(FILES ${PROJECT_SOURCE_DIR}/man/style.css DESTINATION "${CMAKE_INSTALL_DOCDIR}/html") foreach(f ${MAN_SOURCES}) string(REGEX REPLACE "\\.[13]$" "" f ${f}) install(FILES ${PROJECT_BINARY_DIR}/man/${f}.html DESTINATION "${CMAKE_INSTALL_DOCDIR}/html") endforeach() foreach(i RANGE 0 ${MAN_ALIAS_MAX} 2) math(EXPR j "${i} + 1") list(GET MAN_ALIAS ${j} DST) install(FILES ${PROJECT_BINARY_DIR}/man/${DST}.html DESTINATION "${CMAKE_INSTALL_DOCDIR}/html") endforeach() endif() ``` -------------------------------- ### Python API - Asyncio Server Example Source: https://github.com/mysql/mysql-server/blob/trunk/extra/libcno/libcno-208939f540957a35b337dacdd5c5e34d51821bd2/README.md Example of setting up an asyncio server using libcno. ```APIDOC ## Python API - Asyncio Server Example ### Server Setup On Python 3.5+, higher-level asyncio bindings are available. ```python async def handle(request: cno.Request): request.method # :: str request.path # :: str request.headers # :: [(str, str)] request.conn # :: cno.Server -- `protocol` (below) request.payload # :: asyncio.StreamReader # Pushed resources inherit :authority and :scheme from the request unless overriden. request.push('GET', '/index.css', [('x-extra-header', 'value')]) if all_data_is_available: await request.respond(200, [('content-length', '4')], b'!!!\n') else: # `Channel` is a subclass of `asyncio.Queue`. channel = cno.Channel(max_buffered_chunks, loop=request.conn.loop) await channel.put(b'!!!') # this should preferably be done in a separate await channel.put(b'\n') # coroutine, naturally. channel.close() # Or you can use any async iterable instead. await request.respond(200, [], channel) make_protocol = lambda: cno.Server(event_loop, handle) # When using TLS, don't forget to tell clients you support HTTP 2: # ssl_context.set_alpn_protocols(['h2', 'http/1.1']) # ssl_context.set_npn_protocols(['h2', 'http/1.1']) ``` ``` -------------------------------- ### Install Test License and Readme Files Source: https://github.com/mysql/mysql-server/blob/trunk/mysql-test/CMakeLists.txt Installs the LICENSE and README files for the test suite into the documentation directory, renaming them to LICENSE-test and README-test respectively. This is skipped for RPM and DEB install layouts. ```cmake INSTALL(FILES ${CMAKE_SOURCE_DIR}/LICENSE DESTINATION ${INSTALL_DOCREADMEDIR} COMPONENT TestReadme RENAME LICENSE-test ) INSTALL(FILES ${CMAKE_SOURCE_DIR}/README DESTINATION ${INSTALL_DOCREADMEDIR} COMPONENT TestReadme RENAME README-test ) ``` -------------------------------- ### Install Standard Man Pages Source: https://github.com/mysql/mysql-server/blob/trunk/man/CMakeLists.txt Installs the standard man pages to the specified directory. ```cmake INSTALL(FILES ${MAN1} DESTINATION ${INSTALL_MANDIR}/man1 COMPONENT ManPages) ``` ```cmake INSTALL(FILES ${MAN8} DESTINATION ${INSTALL_MANDIR}/man8 COMPONENT ManPages) ``` -------------------------------- ### Compile and Install ZLib Source: https://github.com/mysql/mysql-server/blob/trunk/extra/protobuf/protobuf-24.4/cmake/README.md CMake commands to build and install ZLib on Windows. ```bash C:\Path\to\src\zlib>mkdir C:\Path\to\build\zlib & cd C:\Path\to\build\zlib C:\Path\to\build\zlib>mkdir release & cd release C:\Path\to\build\zlib\release>cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Release ^ -DCMAKE_INSTALL_PREFIX=C:\Path\to\install C:\Path\to\src\zlib C:\Path\to\src\zlib\build\release>cmake --build . --target install ``` -------------------------------- ### ATRT Log: Test Failed - Setup Issue Source: https://github.com/mysql/mysql-server/blob/trunk/storage/ndb/test/run-test/ATRT_USAGE_README.txt Example log output for a test failure related to process setup, even when the configuration file exists. Suggests rerunning make-config.sh. ```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 ``` -------------------------------- ### Build and Run the Simple Example Source: https://github.com/mysql/mysql-server/blob/trunk/extra/opentelemetry-cpp/opentelemetry-cpp-1.23.0/CONTRIBUTING.md Demonstrates the specific Bazel commands to build and then run the 'simple' example within the opentelemetry-cpp project. ```shell bazel build //examples/simple:example_simple bazel-bin/examples/simple/example_simple ``` -------------------------------- ### Sample Test Case Setup and Operations Source: https://github.com/mysql/mysql-server/blob/trunk/mysql-test/mysql-test-run.dox This snippet demonstrates the setup and execution of a sample test case in MySQL. It includes dropping and creating tables, inserting data, and handling SQL warnings. Use this for testing data insertion and table manipulation. ```sql --disable_warnings DROP TABLE IF EXISTS t1; SET @@sql_mode='NO_ENGINE_SUBSTITUTION'; --enable_warnings SET SQL_WARNINGS=1; CREATE TABLE t1 (a INT); INSERT INTO t1 VALUES (1); INSERT INTO t1 VALUES ("hej"); DROP TABLE t1; ``` -------------------------------- ### Determine NDBCLIENT Directory Source: https://github.com/mysql/mysql-server/blob/trunk/storage/ndb/src/ndbjtie/test/CMakeLists.txt Gets the parent directory of the NDBJTIE directory, likely the NDBCLIENT installation path. ```cmake GET_FILENAME_COMPONENT(NDBCLIENT_DIR "${NDBJTIE_DIR}" PATH) ``` -------------------------------- ### Start the Demo Environment Source: https://github.com/mysql/mysql-server/blob/trunk/components/telemetry/test/demo.txt Use this command to start the MySQL demo environment using Docker Compose. ```bash docker compose up -d ``` -------------------------------- ### Install Build Dependencies on Ubuntu/Debian Source: https://github.com/mysql/mysql-server/blob/trunk/extra/protobuf/protobuf-24.4/src/README.md Install necessary tools for building Protobuf from source on Debian-based systems. ```bash sudo apt-get install g++ git bazel ``` -------------------------------- ### Start serve_header.py Source: https://github.com/mysql/mysql-server/blob/trunk/extra/json/json-3.12.0/tools/serve_header/README.md Run the make command to start serving the json.hpp header file. The script expects certificate files in the project root. ```bash $ make serve_header ``` -------------------------------- ### Determine NDBJTIE Directory Source: https://github.com/mysql/mysql-server/blob/trunk/storage/ndb/src/ndbjtie/test/CMakeLists.txt Gets the directory component of the binary directory, likely the NDBJTIE installation path. ```cmake GET_FILENAME_COMPONENT(NDBJTIE_DIR "${BIN_DIR}" PATH) ``` -------------------------------- ### Configure Gzip Installation Source: https://github.com/mysql/mysql-server/blob/trunk/extra/libfido2/libfido2-1.15.0/man/CMakeLists.txt Handles installation of compressed or uncompressed manual pages based on GZIP_PATH availability. ```cmake if(GZIP_PATH) add_dependencies(man_gzip man_copy) add_dependencies(man_symlink_gzip man_gzip) add_dependencies(man man_symlink_gzip) foreach(f ${MAN_SOURCES}) if (${f} MATCHES ".1$") install(FILES ${PROJECT_BINARY_DIR}/man/${f}.gz DESTINATION "${CMAKE_INSTALL_MANDIR}/man1") elseif(${f} MATCHES ".3$") install(FILES ${PROJECT_BINARY_DIR}/man/${f}.gz DESTINATION "${CMAKE_INSTALL_MANDIR}/man3") endif() endforeach() foreach(i RANGE 0 ${MAN_ALIAS_MAX} 2) math(EXPR j "${i} + 1") list(GET MAN_ALIAS ${j} DST) install(FILES ${PROJECT_BINARY_DIR}/man/${DST}.3.gz DESTINATION "${CMAKE_INSTALL_MANDIR}/man3") endforeach() else() add_dependencies(man man_symlink) foreach(f ${MAN_SOURCES}) if (${f} MATCHES ".1$") install(FILES ${PROJECT_BINARY_DIR}/man/${f} DESTINATION "${CMAKE_INSTALL_MANDIR}/man1") elseif(${f} MATCHES ".3$") install(FILES ${PROJECT_BINARY_DIR}/man/${f} DESTINATION "${CMAKE_INSTALL_MANDIR}/man3") endif() endforeach() foreach(i RANGE 0 ${MAN_ALIAS_MAX} 2) math(EXPR j "${i} + 1") list(GET MAN_ALIAS ${j} DST) install(FILES ${PROJECT_BINARY_DIR}/man/${DST}.3 DESTINATION "${CMAKE_INSTALL_MANDIR}/man3") endforeach() endif() ``` -------------------------------- ### Install Protobuf Setuptools Extension Source: https://github.com/mysql/mysql-server/blob/trunk/extra/protobuf/protobuf-24.4/python/protobuf_distutils/README.md Install the setuptools extension for protobuf compilation. This is typically done during the build process of a Python project. ```shell python setup.py build python -m pip install . ``` -------------------------------- ### Add Executable Linking libmytime Source: https://github.com/mysql/mysql-server/blob/trunk/unittest/examples/CMakeLists.txt Creates a 'hello world' style executable that links only with libmytime. It is not intended for installation but serves as an example for applications linking with libmytime and verifies library independence. ```cmake MYSQL_ADD_EXECUTABLE(mytime_client-t mytime_client-t.cc SKIP_INSTALL) TARGET_LINK_LIBRARIES(mytime_client-t mytime ${LIBRT}) ``` -------------------------------- ### ATRT Log: Test Failed - Node Process Missing Source: https://github.com/mysql/mysql-server/blob/trunk/storage/ndb/test/run-test/ATRT_USAGE_README.txt Example log output for a test failure indicating a required process (ndb_cpcd) is not running on a specific node. Recommends starting the process manually. ```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 ``` -------------------------------- ### Install MySQL Router Configuration Sample Source: https://github.com/mysql/mysql-server/blob/trunk/packaging/WiX/router/CMakeLists.txt Installs the generated mysqlrouter.conf.sample file to the 'etc' directory for the Router component. ```cmake INSTALL(FILES "${PROJECT_BINARY_DIR}/stage/\${CMAKE_INSTALL_CONFIG_NAME}/etc/mysqlrouter.conf.sample" DESTINATION "etc" COMPONENT Router) ``` -------------------------------- ### Install Executable Source: https://github.com/mysql/mysql-server/blob/trunk/storage/ndb/src/cw/cpcd/CMakeLists.txt Installs the 'ndb_cpcd' executable to the 'bin' directory within the installation prefix. This makes the executable available in the system's PATH after installation. ```cmake INSTALL(TARGETS ndb_cpcd DESTINATION bin) ``` -------------------------------- ### Install and Export Targets Source: https://github.com/mysql/mysql-server/blob/trunk/extra/curl/curl-8.14.1/lib/CMakeLists.txt Configures installation rules for static and shared libraries and exports the target configuration. ```cmake if(CURL_ENABLE_EXPORT_TARGET) if(BUILD_STATIC_LIBS) install(TARGETS ${LIB_STATIC} EXPORT ${TARGETS_EXPORT_NAME} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) endif() if(BUILD_SHARED_LIBS) install(TARGETS ${LIB_SHARED} EXPORT ${TARGETS_EXPORT_NAME} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) endif() export(TARGETS ${libcurl_export} FILE "${PROJECT_BINARY_DIR}/libcurl-target.cmake" NAMESPACE ${PROJECT_NAME}:: ) endif() ``` -------------------------------- ### Build Documentation Source: https://github.com/mysql/mysql-server/blob/trunk/router/src/harness/README.txt Command to build the documentation for the MySQL Harness using make. ```bash make docs ``` -------------------------------- ### Example of Complex Bootstrap Initialization Source: https://github.com/mysql/mysql-server/blob/trunk/mysql-test/mysql-test-run.dox An example demonstrating multiple bootstrap and server options for initializing a data directory during a test. ```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="" ``` -------------------------------- ### Install Abseil Targets Source: https://github.com/mysql/mysql-server/blob/trunk/extra/abseil/abseil-cpp-20250814.1/CMakeLists.txt Installs the exported targets for the Abseil library, specifying a namespace and installation destination. ```cmake install(EXPORT ${PROJECT_NAME}Targets NAMESPACE absl:: DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}" ) ``` -------------------------------- ### Install Zsh Shell Completion Source: https://github.com/mysql/mysql-server/blob/trunk/extra/curl/curl-8.14.1/scripts/CMakeLists.txt Installs the generated Zsh shell completion script to the appropriate directory if CURL_COMPLETION_ZSH is enabled and installation is not disabled. It determines the installation path using CMake variables. ```cmake if(NOT CURL_COMPLETION_ZSH_DIR AND CMAKE_INSTALL_DATAROOTDIR) set(CURL_COMPLETION_ZSH_DIR "${CMAKE_INSTALL_DATAROOTDIR}/zsh/site-functions") endif() if(CURL_COMPLETION_ZSH_DIR) install(FILES "${_completion_zsh}" DESTINATION "${CURL_COMPLETION_ZSH_DIR}") endif() ``` -------------------------------- ### Install MySQL Harness Source: https://github.com/mysql/mysql-server/blob/trunk/router/src/harness/README.txt Command to install the MySQL Harness files. The installation prefix can be customized using CMAKE_INSTALL_PREFIX. ```bash make install ``` -------------------------------- ### Install Static Zlib Components Source: https://github.com/mysql/mysql-server/blob/trunk/extra/zlib/zlib-1.3.2/CMakeLists.txt Installs the static zlib library and its export files to the specified installation directories. ```cmake if(ZLIB_BUILD_STATIC) install( TARGETS zlibstatic COMPONENT Development EXPORT zlibStaticExport RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}") install( EXPORT zlibStaticExport FILE ZLIB-static.cmake NAMESPACE ZLIB:: DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/zlib) endif(ZLIB_BUILD_STATIC) ``` -------------------------------- ### Install Fish Shell Completion Source: https://github.com/mysql/mysql-server/blob/trunk/extra/curl/curl-8.14.1/scripts/CMakeLists.txt Installs the generated Fish shell completion script to the appropriate directory if CURL_COMPLETION_FISH is enabled and installation is not disabled. It attempts to find the correct installation path using PkgConfig or CMake variables. ```cmake if(NOT CURL_COMPLETION_FISH_DIR AND NOT CMAKE_CROSSCOMPILING AND NOT DEFINED CMAKE_INSTALL_PREFIX) find_package(PkgConfig QUIET) pkg_get_variable(CURL_COMPLETION_FISH_DIR "fish" "completionsdir") endif() if(NOT CURL_COMPLETION_FISH_DIR AND CMAKE_INSTALL_DATAROOTDIR) set(CURL_COMPLETION_FISH_DIR "${CMAKE_INSTALL_DATAROOTDIR}/fish/vendor_completions.d") endif() if(CURL_COMPLETION_FISH_DIR) install(FILES "${_completion_fish}" DESTINATION "${CURL_COMPLETION_FISH_DIR}") endif() ``` -------------------------------- ### Build and test with Maven Source: https://github.com/mysql/mysql-server/blob/trunk/extra/protobuf/protobuf-24.4/java/README.md Commands for verifying the installation, running tests, and packaging the library from source. ```bash $ protoc --version ``` ```bash $ mvn test ``` ```bash $ mvn install ``` ```bash $ mvn package ``` -------------------------------- ### Install Debug Target Source: https://github.com/mysql/mysql-server/blob/trunk/sql/CMakeLists.txt Installs the 'mysqld' target with a '-debug' suffix to the specified installation directory, ensuring debug symbols are available. ```cmake INSTALL_DEBUG_TARGET(mysqld DESTINATION ${INSTALL_SBINDIR} RENAME mysqld-debug${CMAKE_EXECUTABLE_SUFFIX} ) ``` -------------------------------- ### Start a server for manual connection Source: https://github.com/mysql/mysql-server/blob/trunk/mysql-test/mysql-test-run.dox Use these commands to initialize and start a server for manual interaction via the mysql client. ```shell shell> cd mysql-test shell> ./mysql-test-run.pl --start alias & shell> ../mysql -S ./var/tmp/master.sock -h localhost -u root ``` -------------------------------- ### Build with Generated Protobuf Sources Source: https://github.com/mysql/mysql-server/blob/trunk/extra/protobuf/protobuf-24.4/python/protobuf_distutils/README.md Invoke the setuptools command to generate protobuf sources before building and installing the project. This ensures generated code is included in the distribution. ```shell python setup.py generate_py_protobufs python setup.py build python -m pip install . ``` -------------------------------- ### Include Install CMake Module Source: https://github.com/mysql/mysql-server/blob/trunk/extra/protobuf/protobuf-24.4/CMakeLists.txt Includes the CMake module responsible for handling the installation of Protocol Buffers components if installation is enabled. ```cmake if (protobuf_INSTALL) include(${protobuf_SOURCE_DIR}/cmake/install.cmake) endif (protobuf_INSTALL) ``` -------------------------------- ### Wait for Replica to Start Source: https://github.com/mysql/mysql-server/blob/trunk/mysql-test/mysql-test-run.dox Include this file after START REPLICA to ensure both I/O and SQL threads have started and the connection to the master is established. ```sql START REPLICA --source include/rpl/wait_for_replica_to_start.inc ``` -------------------------------- ### Add Example Plugin Source: https://github.com/mysql/mysql-server/blob/trunk/plugin/fulltext/CMakeLists.txt Configures the build for an example full-text search plugin. It specifies the source file and sets the output name for the module. ```cmake MYSQL_ADD_PLUGIN(ftexample example/plugin_example.cc MODULE_ONLY MODULE_OUTPUT_NAME "mypluglib" ) ``` -------------------------------- ### Install mysql_native_password Client Plugin Source: https://github.com/mysql/mysql-server/blob/trunk/router/CMakeLists.txt Installs the mysql_native_password target to the Router's plugin directory when the installation layout is STANDALONE and the target exists. ```cmake INSTALL(TARGETS mysql_native_password RUNTIME DESTINATION ${ROUTER_INSTALL_PLUGINDIR} LIBRARY DESTINATION ${ROUTER_INSTALL_PLUGINDIR} COMPONENT Router NAMELINK_SKIP ) ``` -------------------------------- ### Start Root Shell Source: https://github.com/mysql/mysql-server/blob/trunk/components/telemetry/TESTING.md Begin by entering a root shell to execute subsequent commands. ```shell sudo bash ``` -------------------------------- ### Install Shared Zlib Components Source: https://github.com/mysql/mysql-server/blob/trunk/extra/zlib/zlib-1.3.2/CMakeLists.txt Installs the shared zlib library, its export files, and debug symbols (if applicable) to the specified installation directories. ```cmake if(ZLIB_INSTALL) if(ZLIB_BUILD_SHARED) install( TARGETS zlib COMPONENT Runtime EXPORT zlibSharedExport RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}") install( EXPORT zlibSharedExport FILE ZLIB-shared.cmake NAMESPACE ZLIB:: DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/zlib) if(MSVC) install( FILES $ COMPONENT Runtime DESTINATION ${CMAKE_INSTALL_BINDIR} CONFIGURATIONS Debug OR RelWithDebInfo OPTIONAL) endif(MSVC) endif(ZLIB_BUILD_SHARED) ``` -------------------------------- ### Install mysqlrouter_bootstrap Executable Source: https://github.com/mysql/mysql-server/blob/trunk/router/src/bootstrap/src/CMakeLists.txt Installs the mysqlrouter_bootstrap executable and its related libraries to the specified runtime and library directories. This makes the bootstrap utility available after installation. ```cmake INSTALL(TARGETS mysqlrouter_bootstrap RUNTIME DESTINATION ${ROUTER_INSTALL_BINDIR} COMPONENT Router ARCHIVE DESTINATION ${ROUTER_INSTALL_LIBDIR} COMPONENT Router LIBRARY DESTINATION ${ROUTER_INSTALL_LIBDIR} COMPONENT Router NAMELINK_SKIP ) ``` -------------------------------- ### Configure and Install Rewriter SQL Scripts Source: https://github.com/mysql/mysql-server/blob/trunk/plugin/rewriter/CMakeLists.txt Configures SQL script templates for installing and uninstalling the rewriter plugin and then installs them to the MySQL share directory. ```cmake FOREACH(file install_rewriter uninstall_rewriter) CONFIGURE_FILE( ${CMAKE_CURRENT_SOURCE_DIR}/${file}.sql.in ${CMAKE_CURRENT_BINARY_DIR}/${file}.sql ) INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${file}.sql DESTINATION ${INSTALL_MYSQLSHAREDIR} COMPONENT SupportFiles PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ ) ENDFOREACH() ``` -------------------------------- ### Install OpenTelemetry C++ SDK Source: https://github.com/mysql/mysql-server/blob/trunk/extra/opentelemetry-cpp/opentelemetry-cpp-1.23.0/INSTALL.md Installs the OpenTelemetry C++ header files, SDK targets, and header files to a specified installation root directory. ```console cmake --install . --prefix "//" -- Installing: //lib/cmake/opentelemetry-cpp/opentelemetry-cpp-config.cmake -- Installing: //lib/cmake/opentelemetry-cpp/opentelemetry-cpp-config-version.cmake ... ``` -------------------------------- ### Configure Build Directories and Options Source: https://github.com/mysql/mysql-server/blob/trunk/extra/curl/curl-8.14.1/CMakeLists.txt Sets up installation paths, build options, and adds subdirectories based on project configuration. ```cmake include(GNUInstallDirs) set(_install_cmake_dir "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}") set(TARGETS_EXPORT_NAME "${PROJECT_NAME}Targets") set(_generated_dir "${CMAKE_CURRENT_BINARY_DIR}/generated") set(_project_config "${_generated_dir}/${PROJECT_NAME}Config.cmake") set(_version_config "${_generated_dir}/${PROJECT_NAME}ConfigVersion.cmake") option(BUILD_TESTING "Build tests" ON) if(BUILD_TESTING AND PERL_FOUND) set(CURL_BUILD_TESTING ON) else() set(CURL_BUILD_TESTING OFF) endif() if(HAVE_MANUAL_TOOLS) set(CURL_MANPAGE "${PROJECT_BINARY_DIR}/docs/cmdline-opts/curl.1") set(CURL_ASCIIPAGE "${PROJECT_BINARY_DIR}/docs/cmdline-opts/curl.txt") add_subdirectory(docs) endif() add_subdirectory(scripts) # for shell completions list(REMOVE_DUPLICATES CURL_LIBDIRS) add_subdirectory(lib) if(BUILD_CURL_EXE) add_subdirectory(src) endif() option(BUILD_EXAMPLES "Build libcurl examples" ON) if(BUILD_EXAMPLES) add_subdirectory(docs/examples) endif() if(CURL_BUILD_TESTING) add_subdirectory(tests) endif() ``` -------------------------------- ### Clone and Initialize Protobuf Source Source: https://github.com/mysql/mysql-server/blob/trunk/extra/protobuf/protobuf-24.4/cmake/README.md Commands to download the source code and initialize necessary submodules. ```bash https://github.com/protocolbuffers/protobuf/releases/latest ``` ```bash C:\Path\to> mkdir src & cd src C:\Path\to\src> git clone -b [release_tag] https://github.com/protocolbuffers/protobuf.git ``` ```bash C:\Path\to\src> cd protobuf C:\Path\to\src\protobuf> ``` ```bash C:\Path\to\src\protobuf> git submodule update --init --recursive ``` -------------------------------- ### Clone and Initialize Protobuf Repository Source: https://github.com/mysql/mysql-server/blob/trunk/extra/protobuf/protobuf-24.4/src/README.md Download the source code and initialize required submodules. ```bash git clone https://github.com/protocolbuffers/protobuf.git cd protobuf git submodule update --init --recursive ``` -------------------------------- ### Install MySQL Multi Server Script Source: https://github.com/mysql/mysql-server/blob/trunk/support-files/CMakeLists.txt Installs the mysqld_multi.server script, which is used for managing multiple MySQL server instances. It's installed as a server script. ```cmake INSTALL(SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/mysqld_multi.server COMPONENT Server_Scripts DESTINATION ${INSTALL_SUPPORTFILESDIR} ) ``` -------------------------------- ### Windows Script Installation Source: https://github.com/mysql/mysql-server/blob/trunk/scripts/CMakeLists.txt Configures and installs Perl scripts like mysqld_multi and mysqldumpslow on Windows systems. This ensures essential utility scripts are available after installation. ```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() ELSE() ``` -------------------------------- ### Configure Installation Paths Source: https://github.com/mysql/mysql-server/blob/trunk/extra/json/json-3.12.0/CMakeLists.txt Sets cache variables for installation directories, including data, include, and pkgconfig paths. These determine where the library and its associated files are installed. ```cmake set(NLOHMANN_JSON_CONFIG_INSTALL_DIR "${CMAKE_INSTALL_DATADIR}/cmake/${PROJECT_NAME}" CACHE INTERNAL "") set(NLOHMANN_JSON_INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_INCLUDEDIR}") set(NLOHMANN_JSON_TARGETS_EXPORT_NAME "${PROJECT_NAME}Targets") set(NLOHMANN_JSON_CMAKE_CONFIG_TEMPLATE "cmake/config.cmake.in") set(NLOHMANN_JSON_CMAKE_CONFIG_DIR "${CMAKE_CURRENT_BINARY_DIR}") set(NLOHMANN_JSON_CMAKE_VERSION_CONFIG_FILE "${NLOHMANN_JSON_CMAKE_CONFIG_DIR}/${PROJECT_NAME}ConfigVersion.cmake") set(NLOHMANN_JSON_CMAKE_PROJECT_CONFIG_FILE "${NLOHMANN_JSON_CMAKE_CONFIG_DIR}/${PROJECT_NAME}Config.cmake") set(NLOHMANN_JSON_CMAKE_PROJECT_TARGETS_FILE "${NLOHMANN_JSON_CMAKE_CONFIG_DIR}/${PROJECT_NAME}Targets.cmake") set(NLOHMANN_JSON_PKGCONFIG_INSTALL_DIR "${CMAKE_INSTALL_DATADIR}/pkgconfig") ``` -------------------------------- ### Initialize Root CA Certificate Files Source: https://github.com/mysql/mysql-server/blob/trunk/mysql-test/std_data/bug27491518/cert_generation.txt Sets up the index and serial number files for the root Certificate Authority. ```bash mkdir ca/root.certs touch ca/root.index.txt touch ca/root.index.txt.attr echo '00' > ca/root.serial ``` -------------------------------- ### Server Start and Management Options Source: https://github.com/mysql/mysql-server/blob/trunk/mysql-test/mysql-test-run.dox Options for controlling the startup, initialization, and management of MySQL servers during testing. ```APIDOC ## `--sp-protocol` ### Description Passes the `--sp-protocol` option to `mysqltest`. ### Method N/A (Command-line option) ### Endpoint N/A ``` ```APIDOC ## `--start` ### Description Initializes and starts servers with the specified test case's startup settings. This allows connecting to the server later using clients like `mysql`. `mysql-test-run.pl` terminates after the server starts but monitors it, shutting down if the server dies or is killed. ### Method N/A (Command-line option) ### Endpoint N/A ### Request Example ```bash ./mysql-test-run.pl --start alias & ../mysql -S ./var/tmp/master.sock -h localhost -u root ``` ``` ```APIDOC ## `--start-and-exit` ### Description Similar to `--start`, this option starts the server and then terminates `mysql-test-run.pl`, leaving only the server process running. ### Method N/A (Command-line option) ### Endpoint N/A ``` ```APIDOC ## `--start-dirty` ### Description Similar to `--start`, but skips the database initialization phase, assuming database files are already available. This typically means another test must have been run previously. ### Method N/A (Command-line option) ### Endpoint N/A ``` ```APIDOC ## `--start-from` ### Description `mysql-test-run.pl` sorts the list of test cases to be run and begins execution starting from the specified `test_name`. ### Method N/A (Command-line option) ### Endpoint N/A ### Parameters #### Query Parameters - **test_name** (string) - Required - The name of the test case to start from. ``` -------------------------------- ### Install Windows Runtime Libraries Source: https://github.com/mysql/mysql-server/blob/trunk/CMakeLists.txt Conditionally installs specified Windows runtime libraries (e.g., msvcp140.dll) to the installation bin directory if BUNDLE_RUNTIME_LIBRARIES is enabled and the files exist. ```cmake IF(WIN32) OPTION(BUNDLE_RUNTIME_LIBRARIES "INSTALL runtime libraries" OFF) IF(BUNDLE_RUNTIME_LIBRARIES) SET(RUNTIME_LIBRARIES msvcp140 ucrtbase vcruntime140 ) FOREACH(LIB ${RUNTIME_LIBRARIES}) SET(LIB_PATH "C:/Windows/System32/${LIB}.dll") SET(LIB_D_PATH "C:/Windows/System32/${LIB}d.dll") FOREACH(LIBRARY_PATH ${LIB_PATH} ${LIB_D_PATH}) IF(EXISTS "${LIBRARY_PATH}") MESSAGE(STATUS "INSTALL ${LIBRARY_PATH} to ${INSTALL_BINDIR}") INSTALL(FILES "${LIBRARY_PATH}" DESTINATION "${INSTALL_BINDIR}" COMPONENT SharedLibraries) ELSE() MESSAGE(STATUS "Could not find ${LIBRARY_PATH}") ENDIF() ENDFOREACH() ENDFOREACH() ENDIF() ENDIF() ``` -------------------------------- ### Install Abseil Configuration Header Source: https://github.com/mysql/mysql-server/blob/trunk/extra/abseil/abseil-cpp-20250814.1/CMakeLists.txt This command installs the generated Abseil configuration header file to the appropriate destination directory, renaming it to 'options.h' as part of the installation process. ```cmake install(FILES "${CMAKE_BINARY_DIR}/options-pinned.h" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/absl/base RENAME "options.h") ``` -------------------------------- ### Configure setup.py for Protobuf Generation Source: https://github.com/mysql/mysql-server/blob/trunk/extra/protobuf/protobuf-24.4/python/protobuf_distutils/README.md Configure your project's setup.py to use the protobuf_distutils extension. Specify source directories, output directories, and specific proto files to generate Python code. ```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', }, }, ) ``` -------------------------------- ### Start ndb_cpcd Daemon Source: https://github.com/mysql/mysql-server/blob/trunk/storage/ndb/test/run-test/ATRT_SETUP_README.txt Command to start the ndb_cpcd daemon. It redirects output to /dev/null and runs in the background. Ensure the process starts correctly by checking the log file. ```bash $MYSQL_DIR/libexec/ndb_cpcd > /dev/null 2>&1 & ``` -------------------------------- ### Prepare revocation environment Source: https://github.com/mysql/mysql-server/blob/trunk/mysql-test/std_data/crl-certificate-readme.txt Setup commands for certificate revocation. ```bash cp crl-ca-cert.pem cacert.pem cp crl-ca-key.pem private/cakey.pem touch index.txt echo 1000 > crlnumber ``` -------------------------------- ### Install libfido2 on macOS Source: https://github.com/mysql/mysql-server/blob/trunk/extra/libfido2/libfido2-1.15.0/README.adoc Installs libfido2 on macOS using Homebrew. ```bash brew install libfido2 ``` -------------------------------- ### Start MySQL Server Mock for Metadata Source: https://github.com/mysql/mysql-server/blob/trunk/router/src/mock_server/src/mysql_server_mock.md Use this command to start a mock MySQL server for metadata. Ensure the --mysqld-port is set to 5500 and the --stmt-file points to the metadata-store.yaml. ```bash ./mysql_server_mock --mysqld-port=5500 --stmt-file=./metadata-store.yaml ``` -------------------------------- ### Python API - Installation Source: https://github.com/mysql/mysql-server/blob/trunk/extra/libcno/libcno-208939f540957a35b337dacdd5c5e34d51821bd2/README.md Installation instructions for the Python API of libcno. ```APIDOC ## Python API - Installation ### Requirements ```bash pip3 install cffi pip3 install git+https://github.com/pyos/libcno ``` ``` -------------------------------- ### Starting MySQL Client with Telemetry Plugin Source: https://github.com/mysql/mysql-server/blob/trunk/components/telemetry/TESTING.md Launch the MySQL client with the telemetry plugin enabled by specifying the plugin directory and using the --telemetry-client flag or setting it in my.cnf. ```bash ./runtime_output_directory/mysql \ --socket=./mysql-test/var/tmp/mysqld.1.sock \ --user=root \ --plugin_dir=./plugin_output_directory \ --telemetry-client ``` -------------------------------- ### Install SASL Libraries and Plugins Source: https://github.com/mysql/mysql-server/blob/trunk/libmysql/authentication_ldap/CMakeLists.txt Installs the SASL library and its plugins to the specified installation directories. Ensure the SASL library is placed in the 'bin' directory and plugins in the 'bin/sasl2' directory. ```cmake INSTALL(FILES "${SASL_LIBRARY_DLL}" DESTINATION ${INSTALL_BINDIR} COMPONENT SharedLibraries) INSTALL(FILES "${SASL_SCRAM_PLUGIN}" DESTINATION "${INSTALL_BINDIR}/sasl2" COMPONENT SharedLibraries) INSTALL(FILES "${SASL_GSSAPI_PLUGIN}" DESTINATION "${INSTALL_BINDIR}/sasl2" COMPONENT SharedLibraries) ``` -------------------------------- ### Define WITH_EXAMPLES_HTTP Option Source: https://github.com/mysql/mysql-server/blob/trunk/extra/opentelemetry-cpp/opentelemetry-cpp-1.23.0/CMakeLists.txt Enables the building of HTTP client and server examples. This option requires both WITH_EXAMPLES and CURL to be enabled. ```cmake # This requires CURL, OFF by default. option( WITH_EXAMPLES_HTTP "Whether to build http client/server examples. Requires WITH_EXAMPLES and CURL" OFF ) ``` -------------------------------- ### Start MySQL Server Mock Source: https://github.com/mysql/mysql-server/blob/trunk/router/src/mock_server/src/mysql_server_mock.md Launches the MySQL Server Mock, specifying the JSON trace file and the port to listen on. This command starts the mock server for testing. ```bash ./mysql_server_mock ./simple.json 5500 ``` -------------------------------- ### Install Directories for Standalone Layout Source: https://github.com/mysql/mysql-server/blob/trunk/router/src/router/CMakeLists.txt Iterates through directory variables (LOGDIR, RUNTIMEDIR, CONFIGDIR, DATADIR) and installs them if the installation layout is STANDALONE. Ensures required directories are created with specific permissions. ```cmake IF(INSTALL_LAYOUT STREQUAL "STANDALONE") FOREACH(_dirvar LOGDIR RUNTIMEDIR CONFIGDIR DATADIR) SET(_dir ${ROUTER_INSTALL_${_dirvar}}) IF(NOT _dir) MESSAGE(FATAL_ERROR "ROUTER_INSTALL_${_dirvar} is empty.") ENDIF() # create a empty directory in the install folder INSTALL(DIRECTORY DESTINATION "${_dir}" DIRECTORY_PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_WRITE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE COMPONENT Router ) ENDFOREACH() ENDIF() ``` -------------------------------- ### Initialize Intermediate CA1 Certificate Files Source: https://github.com/mysql/mysql-server/blob/trunk/mysql-test/std_data/bug27491518/cert_generation.txt Sets up the necessary files and generates the private key for Intermediate CA1. ```bash mkdir ca/intermediate_ca1.certs touch ca/intermediate_ca1.index.txt touch ca/intermediate_ca1.index.txt.attr echo '00' > ca/intermediate_ca1.serial openssl genrsa -out ca/intermediate_ca1.key 2048 ``` -------------------------------- ### Install Ndb Test Runner Source: https://github.com/mysql/mysql-server/blob/trunk/storage/ndb/test/run-test/CMakeLists.txt Installs the 'atrt-mysql-test-run' executable to the 'bin' directory. ```cmake INSTALL(PROGRAMS atrt-mysql-test-run DESTINATION bin) ``` -------------------------------- ### Install Bazel on Mac Source: https://github.com/mysql/mysql-server/blob/trunk/extra/protobuf/protobuf-24.4/src/README.md Commands for installing Bazel using MacPorts or Homebrew. ```bash sudo /opt/local/bin/port install bazel ``` ```bash brew install bazel ``` -------------------------------- ### Install Protoc Binary on Linux Source: https://github.com/mysql/mysql-server/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 ```