### Install Multiple Components Source: https://dev.mysql.com/doc/refman/8.4/en/install-component.html Example of installing two components using their file URNs. ```sql INSTALL COMPONENT 'file://component1', 'file://component2'; ``` -------------------------------- ### Install Components with Variable Settings Source: https://dev.mysql.com/doc/refman/8.4/en/install-component.html Example of installing components and setting global and persistent variables for them. ```sql INSTALL COMPONENT 'file://component1', 'file://component2' SET GLOBAL component1.var1 = 12 + 3, PERSIST component2.var2 = 'strings'; ``` -------------------------------- ### Install MySQL Client Libraries Source: https://dev.mysql.com/doc/refman/8.4/en/linux-installation-apt-repo.html Example of installing the shared client libraries for MySQL using APT. ```bash sudo apt-get install libmysqlclient21 ``` -------------------------------- ### Example: Install Specific MySQL APT Repository Package Source: https://dev.mysql.com/doc/refman/8.4/en/linux-installation-apt-repo.html Example command to install a specific version of the MySQL APT repository configuration package. Replace `w.x.y-z` with the actual version number. ```bash $> sudo dpkg -i mysql-apt-config__w.x.y-z__all.deb ``` -------------------------------- ### Install MySQL Benchmark Suite Source: https://dev.mysql.com/doc/refman/8.4/en/linux-installation-sles-repo.html Example command to install the MySQL benchmark suite package from an enabled subrepository. ```bash $> sudo zypper install mysql-community-bench ``` -------------------------------- ### Start mysqld_safe from MySQL Installation Directory Source: https://dev.mysql.com/doc/refman/8.4/en/mysqld-safe.html Shows how to navigate to the MySQL installation directory and start the mysqld server using mysqld_safe. This is a common method when the server and data directories are located relative to the installation path. ```bash cd _mysql_installation_directory_ bin/mysqld_safe & ``` -------------------------------- ### Database and Table Setup for EXPLAIN Example Source: https://dev.mysql.com/doc/refman/8.4/en/derived-tables.html Creates a database 'd1' and two tables, 't1' and 't2', along with a stored function 'f1' that inserts data into 't2'. This setup is used to demonstrate behavior with EXPLAIN. ```sql CREATE DATABASE d1; USE d1; CREATE TABLE t1 (c1 INT); CREATE TABLE t2 (c1 INT); CREATE FUNCTION f1(p1 INT) RETURNS INT BEGIN INSERT INTO t2 VALUES (p1); RETURN p1; END; ``` -------------------------------- ### Example Startup Options Source: https://dev.mysql.com/doc/refman/8.4/en/audit-log-file-formats.html Shows the format for the STARTUP_OPTIONS attribute, a string representing the options used when starting the MySQL server. ```text STARTUP_OPTIONS="--port=3306 --log_output=FILE" ``` -------------------------------- ### MySQL Subquery Optimization Example Setup Source: https://dev.mysql.com/doc/refman/8.4/en/switchable-optimizations.html Sets up tables and inserts data for demonstrating subquery optimization. ```mysql DROP TABLE IF EXISTS t1, t2; CREATE TABLE t1 (a INT, b INT); CREATE TABLE t2 (a INT, b INT); INSERT INTO t1 VALUES ROW(1,10), ROW(2,20), ROW(3,30); INSERT INTO t2 VALUES ROW(1,10), ROW(2,20), ROW(3,30), ROW(1,110), ROW(2,120), ROW(3,130); ``` -------------------------------- ### Example MySQL APT Repository Entry for Ubuntu 22.04 Source: https://dev.mysql.com/doc/refman/8.4/en/linux-installation-apt-repo.html This example shows how to configure the MySQL APT repository for Ubuntu 22.04 to install MySQL 8.4 and MySQL Connectors. ```text deb http://repo.mysql.com/apt/ubuntu/ jammy mysql-8.4 mysql-tools ``` -------------------------------- ### Example Output of SHOW plugins Source: https://dev.mysql.com/doc/refman/8.4/en/x-plugin-checking-installation.html This is an example of the output from the 'SHOW plugins' statement when the X Plugin is installed and active. Look for the 'mysqlx' entry with 'ACTIVE' status. ```text +----------------------------+----------+--------------------+---------+---------+ | Name | Status | Type | Library | License | +----------------------------+----------+--------------------+---------+---------+ ... | mysqlx | ACTIVE | DAEMON | NULL | GPL | ... +----------------------------+----------+--------------------+---------+---------+ ``` -------------------------------- ### Start MySQL Server Source: https://dev.mysql.com/doc/refman/8.4/en/windows-start-command-line.html Use this command to start the mysqld server from the command line. The path may vary based on your installation. ```bash C:\> "C:\Program Files\MySQL\MySQL Server 8.4\bin\mysqld" ``` -------------------------------- ### Start MySQL Server using systemctl Source: https://dev.mysql.com/doc/refman/8.4/en/linux-installation-native.html After installation, use the systemctl command to start the MySQL server daemon (mysqld). ```bash $> systemctl start mysqld ``` -------------------------------- ### Start Replica MySQL Server (Windows) Source: https://dev.mysql.com/doc/refman/8.4/en/replication-solutions-backups-rawdata.html Start the MySQL server on Windows by executing the mysqld command from its installation directory. Ensure the correct path to the executable is provided. ```batch C:\"Program Files"\MySQL\MySQL Server 8.4\bin\mysqld ``` -------------------------------- ### Install MySQL Workbench Source: https://dev.mysql.com/doc/refman/8.4/en/linux-installation-apt-repo.html Example of installing a specific MySQL component, MySQL Workbench Community edition, using APT. ```bash sudo apt-get install mysql-workbench-community ``` -------------------------------- ### Install MySQL Server and Client Packages Source: https://dev.mysql.com/doc/refman/8.4/en/linux-installation-debian.html Install the necessary MySQL server and client packages for a basic setup. This command installs common files, client plugins, client core, client, server core, server, and server metapackages. ```bash $> sudo dpkg -i mysql-{common,community-client-plugins,community-client-core,community-client,client,community-server-core,community-server,server}_*.deb ``` -------------------------------- ### Install and Enable MySQL Startup Script Source: https://dev.mysql.com/doc/refman/8.4/en/mysql-cluster-install-linux-binary.html Copies the MySQL server startup script to the system's init directory, makes it executable, and registers it to start on system boot using chkconfig. This ensures MySQL starts automatically. ```bash $> cp support-files/mysql.server /etc/rc.d/init.d/ $> chmod +x /etc/rc.d/init.d/mysql.server $> chkconfig --add mysql.server ``` -------------------------------- ### Start mysqld with Console Output on Windows Source: https://dev.mysql.com/doc/refman/8.4/en/innodb-init-startup-configuration.html Start the MySQL server from a command prompt to view InnoDB initialization information printed to the console. This example shows the command for Windows. ```batch C:\> "C:\Program Files\MySQL\MySQL Server 8.4\bin\mysqld" --console ``` -------------------------------- ### Start MySQL Server with Init File and Defaults File (Windows) Source: https://dev.mysql.com/doc/refman/8.4/en/resetting-permissions.html When MySQL is installed using the Installation Wizard, you may need to specify the --defaults-file option along with --init-file. The correct path for --defaults-file can be found in the Services Manager. ```bash C:\> mysqld --defaults-file="C:\\ProgramData\\MySQL\\MySQL Server 8.4\\my.ini" --init-file=C:\\mysql-init.txt ``` -------------------------------- ### Start NDB Cluster Backup (Specific Example) Source: https://dev.mysql.com/doc/refman/8.4/en/mysql-cluster-replication-backups.html Example of starting an NDB Cluster backup using specific host and port details for a replication source. ```shell shell_S_> ndb_mgm rep-source:1186 -e "START BACKUP" ``` -------------------------------- ### Example: Install SLES 15 MySQL Repository Package Source: https://dev.mysql.com/doc/refman/8.4/en/linux-installation-sles-repo.html Example of installing the SLES 15 package. Replace `#` with the release number within the version (e.g., `15-1`). ```bash sudo rpm -Uvh mysql84-community-release-sl15-_#_.noarch.rpm ``` -------------------------------- ### Start MySQL Services Source: https://dev.mysql.com/doc/refman/8.4/en/multiple-windows-services.html Start the installed MySQL services using the `SC START` command with their respective service names. ```bash C:\> SC START mysqld1 C:\> SC START mysqld2 ``` -------------------------------- ### Example: SHOW CREATE DATABASE Source: https://dev.mysql.com/doc/refman/8.4/en/show-create-database.html This example demonstrates how to use SHOW CREATE DATABASE to view the creation statement for the 'test' database. The \G terminator formats the output vertically. ```sql mysql> SHOW CREATE DATABASE test\G *************************** 1. row *************************** Database: test Create Database: CREATE DATABASE `test` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci */ /*!80014 DEFAULT ENCRYPTION='N' */ ``` -------------------------------- ### Server Startup Options Example Source: https://dev.mysql.com/doc/refman/8.4/en/audit-log-file-formats.html A string representing the options given on the command line or in option files when the MySQL server was started. The first option is the path to the server executable. ```xml /usr/local/mysql/bin/mysqld --port=3306 --log_output=FILE ``` -------------------------------- ### Start NDB Cluster Data Node Service Source: https://dev.mysql.com/doc/refman/8.4/en/mysql-cluster-install-windows-service.html Use the SC START command to start an installed NDB Cluster data node service. ```bash C:\> SC START dnode1 ``` -------------------------------- ### Example Output of setup_instruments Table Source: https://dev.mysql.com/doc/refman/8.4/en/performance-schema-setup-instruments-table.html This output shows the structure of the setup_instruments table when thread names are exported to the operating system. Threads are named similarly to their instrument names, with numbered instances for distinct threads. ```text PID TID CMD COMMAND 27668 27668 /usr/sbin/mysqld mysqld 27668 27671 /usr/sbin/mysqld ib_io_ibuf 27668 27672 /usr/sbin/mysqld ib_io_log 27668 27673 /usr/sbin/mysqld ib_io_rd-1 27668 27674 /usr/sbin/mysqld ib_io_rd-2 27668 27677 /usr/sbin/mysqld ib_io_wr-1 27668 27678 /usr/sbin/mysqld ib_io_wr-2 27668 27699 /usr/sbin/mysqld xpl_worker-2 27668 27700 /usr/sbin/mysqld xpl_accept-1 27668 27710 /usr/sbin/mysqld evt_sched 27668 27711 /usr/sbin/mysqld sig_handler 27668 27933 /usr/sbin/mysqld connection ``` -------------------------------- ### Install Plugin Source: https://dev.mysql.com/doc/refman/8.4/en/performance-schema-status-monitoring.html Installing a plugin can increase the number of loaded mutex instruments. This example shows the effect of installing 'plugin_a' when the server has room for more instruments. ```sql INSTALL PLUGIN plugin_a; ``` -------------------------------- ### NDB Cluster Backup with WAIT STARTED Option Source: https://dev.mysql.com/doc/refman/8.4/en/mysql-cluster-backup-using-management-client.html Example of starting a backup with the WAIT STARTED option, where the management client waits until the backup begins. ```sql ndb_mgm> START BACKUP WAIT STARTED ``` -------------------------------- ### Create an EXAMPLE Table Source: https://dev.mysql.com/doc/refman/8.4/en/example-storage-engine.html Use this command to create a table with the EXAMPLE storage engine. This engine is a stub and does not store data. ```sql mysql> CREATE TABLE test (i INT) ENGINE = EXAMPLE; Query OK, 0 rows affected (0.78 sec) ``` -------------------------------- ### Install and Make mysql.server Executable Source: https://dev.mysql.com/doc/refman/8.4/en/mysql-server.html Copy the mysql.server script to the init.d directory and make it executable for system startup management. ```bash cp mysql.server /etc/init.d/mysql chmod +x /etc/init.d/mysql ``` -------------------------------- ### Start Restored MySQL Server Source: https://dev.mysql.com/doc/refman/8.4/en/group-replication-enterprise-backup.html Start the MySQL server on the restored host. This example uses systemd. ```bash systemctl start mysqld ``` -------------------------------- ### Example Setup Objects for Table Filtering Source: https://dev.mysql.com/doc/refman/8.4/en/performance-schema-object-filtering.html Illustrates specific rows in the setup_objects table for TABLE objects, demonstrating how different schema and name patterns with ENABLED and TIMED settings affect monitoring. ```sql +-------------+---------------+-------------+---------+-------+ | OBJECT_TYPE | OBJECT_SCHEMA | OBJECT_NAME | ENABLED | TIMED | +-------------+---------------+-------------+---------+-------+ | TABLE | db1 | t1 | YES | YES | | TABLE | db1 | t2 | NO | NO | | TABLE | db2 | % | YES | YES | | TABLE | db3 | % | NO | NO | +-------------+---------------+-------------+---------+-------+ ``` -------------------------------- ### Handling Component Dependencies with INSTALL COMPONENT Source: https://dev.mysql.com/doc/refman/8.4/en/install-component.html When installing components, ensure all dependencies are met by installing them in the same statement or installing dependent components after their prerequisites. This example shows a common error related to unmet dependencies. ```sql ERROR 3527 (HY000): Cannot satisfy dependency for service 'component_a' required by component 'component_b'. ``` -------------------------------- ### Display Brief Server Help Source: https://dev.mysql.com/doc/refman/8.4/en/server-options.html Execute this command to see a brief summary of available mysqld server options. This is useful for a quick overview of common settings. ```bash mysqld --help ``` -------------------------------- ### Install Another Plugin Source: https://dev.mysql.com/doc/refman/8.4/en/performance-schema-status-monitoring.html Installing another plugin, such as 'plugin_b', can further increase the number of loaded mutex instruments if sufficient capacity remains. This example shows the installation of 'plugin_b'. ```sql INSTALL PLUGIN plugin_b; ``` -------------------------------- ### Loading Plugins with --plugin-load and --plugin-load-add Source: https://dev.mysql.com/doc/refman/8.4/en/plugin-loading.html Demonstrates equivalent ways to specify plugins for loading at startup using --plugin-load and --plugin-load-add options. Use these options to load plugins before or after built-in components initialize. ```bash --plugin-load=x --plugin-load-add=y ``` ```bash --plugin-load-add=x --plugin-load-add=y ``` ```bash --plugin-load="x;y" ``` -------------------------------- ### Example NDB Cluster Log Event Source: https://dev.mysql.com/doc/refman/8.4/en/mysql-cluster-log-events.html An example of a log event indicating a successful start phase completion for a node. ```text 09:19:30 2005-07-24 [NDB] INFO -- Node 4 Start phase 4 completed ``` -------------------------------- ### Basic Optimizer Hint Syntax Examples Source: https://dev.mysql.com/doc/refman/8.4/en/optimizer-hints.html Illustrates the basic syntax for various optimizer hints within /*+ ... */ comments. ```sql /*+ BKA(t1) */ ``` ```sql /*+ BNL(t1, t2) */ ``` ```sql /*+ NO_RANGE_OPTIMIZATION(t4 PRIMARY) */ ``` ```sql /*+ QB_NAME(qb2) */ ``` -------------------------------- ### Replication Chain Example Source: https://dev.mysql.com/doc/refman/8.4/en/replication-options-binary-log.html Illustrates a chained replication setup (A -> B -> C) where server B acts as both a replica and a source. This requires binary logging and log_replica_updates to be enabled on B. ```text A -> B -> C ``` -------------------------------- ### Install MySQL Workbench on Fedora Source: https://dev.mysql.com/doc/refman/8.4/en/linux-installation-yum-repo.html Example command to install the MySQL Workbench community edition on Fedora using dnf. ```bash sudo dnf install mysql-workbench-community ``` -------------------------------- ### Install MySQL Server as a Manual Service Source: https://dev.mysql.com/doc/refman/8.4/en/windows-start-service.html Use this command to install the MySQL server as a service that does not start automatically during the boot process. Ensure the path to 'mysqld' is correct for your installation. ```bash C:\> "C:\Program Files\MySQL\MySQL Server 8.4\bin\mysqld" --install-manual ``` -------------------------------- ### Kerberos Configuration File Example Source: https://dev.mysql.com/doc/refman/8.4/en/ldap-pluggable-authentication.html Example content for the /etc/krb5.conf file to configure a MYSQL.LOCAL domain for MySQL authentication. ```ini [realms] MYSQL.LOCAL = { kdc = ldap_auth.example.com admin_server = ldap_auth.example.com default_domain = MYSQL.LOCAL } ``` -------------------------------- ### Example: SHOW CREATE SCHEMA Source: https://dev.mysql.com/doc/refman/8.4/en/show-create-database.html This example shows the usage of SHOW CREATE SCHEMA, which is a synonym for SHOW CREATE DATABASE. It retrieves the creation statement for the 'test' database with vertical output formatting. ```sql mysql> SHOW CREATE SCHEMA test\G *************************** 1. row *************************** Database: test Create Database: CREATE DATABASE `test` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci */ /*!80014 DEFAULT ENCRYPTION='N' */ ``` -------------------------------- ### Initialize using Option File (Windows) Source: https://dev.mysql.com/doc/refman/8.4/en/data-directory-initialization.html On Windows, invoke mysqld with --initialize, --console, and --defaults-file pointing to your configuration file. ```bash bin\mysqld --defaults-file=C:\my.ini --initialize --console ``` -------------------------------- ### Example MySQL 8.0 Community Repository Configuration Source: https://dev.mysql.com/doc/refman/8.4/en/linux-installation-yum-repo.html This is an example of a MySQL 8.0 Community Server repository entry, showing how to enable it for installation. ```ini [mysql80-community] name=MySQL 8.0 Community Server baseurl=http://repo.mysql.com/yum/mysql-8.0-community/el/8/$basearch enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2025 ``` -------------------------------- ### SHOW CREATE TABLE Output Example Source: https://dev.mysql.com/doc/refman/8.4/en/show-create-table.html This example shows the typical output of SHOW CREATE TABLE for a simple table named 't'. The output includes the full CREATE TABLE statement. ```sql mysql> SHOW CREATE TABLE t\G *************************** 1. row *************************** Table: t Create Table: CREATE TABLE `t` ( `id` int NOT NULL AUTO_INCREMENT, `s` char(60) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ``` -------------------------------- ### Get the Start Point of a LineString Source: https://dev.mysql.com/doc/refman/8.4/en/gis-linestring-property-functions.html Returns the Point that is the start point of a LineString value. The geometry is first converted from text to a spatial object. ```sql SET @ls = 'LineString(1 1,2 2,3 3)'; SELECT ST_AsText(ST_StartPoint(ST_GeomFromText(@ls))); ``` -------------------------------- ### Create Database and Tables Source: https://dev.mysql.com/doc/refman/8.4/en/sys-table-exists.html Sets up a database and creates a permanent table, a view, and a temporary table for testing the table_exists() procedure. ```sql CREATE DATABASE db1; USE db1; CREATE TABLE t1 (id INT PRIMARY KEY); CREATE TABLE t2 (id INT PRIMARY KEY); CREATE view v_t1 AS SELECT * FROM t1; CREATE TEMPORARY TABLE t1 (id INT PRIMARY KEY); ``` -------------------------------- ### Install Keyring AWS Plugin Functions Source: https://dev.mysql.com/doc/refman/8.4/en/keyring-aws-plugin.html These SQL statements are used to install the keyring_aws plugin functions once the server has started and the plugin is loaded. This is a one-time operation. ```sql CREATE FUNCTION keyring_aws_rotate_cmk RETURNS INTEGER SONAME 'keyring_aws.so'; CREATE FUNCTION keyring_aws_rotate_keys RETURNS INTEGER SONAME 'keyring_aws.so'; ``` -------------------------------- ### Create a Hash-Partitioned Table with InnoDB Source: https://dev.mysql.com/doc/refman/8.4/en/partitioning-overview.html This example demonstrates creating a table partitioned by hash on the month of a date column, using the InnoDB storage engine and specifying the number of partitions. Ensure the storage engine is listed before partitioning options. ```sql CREATE TABLE ti (id INT, amount DECIMAL(7,2), tr_date DATE) ENGINE=INNODB PARTITION BY HASH( MONTH(tr_date) ) PARTITIONS 6; ``` -------------------------------- ### Add Partition and Reorganize LIST Partitions Source: https://dev.mysql.com/doc/refman/8.4/en/partitioning-management-range-list.html This example demonstrates adding a new LIST partition and then reorganizing it with an existing partition to redistribute values. ```sql ALTER TABLE tt ADD PARTITION (PARTITION np VALUES IN (4, 8)); ``` ```sql ALTER TABLE tt REORGANIZE PARTITION p1,np INTO ( PARTITION p1 VALUES IN (6, 18), PARTITION np VALUES in (4, 8, 12) ); ``` -------------------------------- ### Set Installation Layout and Data Directory Source: https://dev.mysql.com/doc/refman/8.4/en/source-configuration-options.html Example of setting a predefined installation layout (SVR4) and specifying a custom data directory during the CMake configuration process. ```bash cmake . -DINSTALL_LAYOUT=SVR4 -DMYSQL_DATADIR=/var/mysql/data ``` -------------------------------- ### Example CREATE SERVER Statement Source: https://dev.mysql.com/doc/refman/8.4/en/create-server.html Provides a concrete example of creating a server definition for a foreign data wrapper. This snippet demonstrates how to specify the user, host, and database for the connection. ```sql CREATE SERVER s FOREIGN DATA WRAPPER mysql OPTIONS (USER 'Remote', HOST '198.51.100.106', DATABASE 'test'); ``` -------------------------------- ### Example: Using GET DIAGNOSTICS in MySQL Client Source: https://dev.mysql.com/doc/refman/8.4/en/get-diagnostics.html Demonstrates how to use GET DIAGNOSTICS to retrieve error information after an SQL statement fails in the MySQL client. ```mysql mysql> DROP TABLE test.no_such_table; ERROR 1051 (42S02): Unknown table 'test.no_such_table' mysql> GET DIAGNOSTICS CONDITION 1 @p1 = RETURNED_SQLSTATE, @p2 = MESSAGE_TEXT; mysql> SELECT @p1, @p2; +-------+------------------------------------+ | @p1 | @p2 | +-------+------------------------------------+ | 42S02 | Unknown table 'test.no_such_table' | +-------+------------------------------------+ ``` -------------------------------- ### Args Field Example (Startup Arguments) Source: https://dev.mysql.com/doc/refman/8.4/en/audit-log-file-formats.html An array of options given on the command line or in option files when the MySQL server was started. The first option is the path to the server executable. ```json "args": ["/usr/local/mysql/bin/mysqld", "--loose-audit-log-format=JSON", "--log-error=log.err", "--pid-file=mysqld.pid", "--port=3306" ] ``` -------------------------------- ### Example /etc/hosts Configuration for NDB Cluster Source: https://dev.mysql.com/doc/refman/8.4/en/mysql-cluster-installation.html This is an example of an /etc/hosts file configuration for an NDB Cluster setup. It defines loopback and cluster hostnames for network resolution. ```text 127.0.0.1 localhost 127.0.0.2 ndb2.cluster ndb2 ``` -------------------------------- ### Install NDB Cluster Management Node with a Custom Service Name Source: https://dev.mysql.com/doc/refman/8.4/en/mysql-cluster-install-windows-service.html Specify a custom service name by appending it to the `--install` option when installing the management node. This custom name is then used for starting, stopping, and deleting the service. ```bash C:\> C:\mysql\bin\ndb_mgmd.exe --install=mgmd1 Installing service 'NDB Cluster Management Server' as '"C:\mysql\bin\ndb_mgmd.exe" "--service=mgmd1"' Service successfully installed. ``` -------------------------------- ### Configuring Multiple Key Caches via Command-Line Source: https://dev.mysql.com/doc/refman/8.4/en/structured-system-variables.html Demonstrates starting the MySQL server with multiple key caches, including the default and custom instances, by specifying their respective parameters on the command line. ```bash $> mysqld --key_buffer_size=256K \ --extra_cache.key_buffer_size=128K \ --extra_cache.key_cache_block_size=2048 ``` -------------------------------- ### Basic Source Distribution Installation Sequence (Unix) Source: https://dev.mysql.com/doc/refman/8.4/en/installing-source-distribution.html This sequence outlines the fundamental steps for installing MySQL from a compressed tar file source distribution on Unix-like systems. It includes user/group setup, unpacking, configuration, building, and installation. ```bash # Preconfiguration setup $> groupadd mysql $> useradd -r -g mysql -s /bin/false mysql # Beginning of source-build specific instructions $> tar zxvf mysql-_VERSION_.tar.gz $> cd mysql-_VERSION_ $> mkdir bld $> cd bld $> cmake .. $> make $> make install # End of source-build specific instructions # Postinstallation setup $> cd /usr/local/mysql $> mkdir mysql-files $> chown mysql:mysql mysql-files $> chmod 750 mysql-files $> bin/mysqld --initialize --user=mysql $> bin/mysqld_safe --user=mysql & # Next command is optional $> cp support-files/mysql.server /etc/init.d/mysql.server ``` -------------------------------- ### Start and Stop NDB Cluster Management Service with Custom Name Source: https://dev.mysql.com/doc/refman/8.4/en/mysql-cluster-install-windows-service.html Use the custom service name specified during installation with `SC START` and `SC STOP` commands. ```bash C:\> SC START mgmd1 C:\> SC STOP mgmd1 ``` -------------------------------- ### Start MySQL Community Server Docker Container Source: https://dev.mysql.com/doc/refman/8.4/en/docker-mysql-getting-started.html Example command to start a Docker container for the MySQL Community Server. It uses a specific image name and tag. ```bash docker run --name=mysql1 --restart on-failure -d container-registry.oracle.com/mysql/community-server:latest ```