### Show Usage Examples Source: https://github.com/proxysql/dbdeployer/blob/master/docs/API/API-1.13.md Shows syntax and examples of tools installed in database sandboxes. Accepts 'single' or 'multiple' as arguments. ```bash $ dbdeployer usage -h ``` -------------------------------- ### Show dbdeployer Usage Examples Source: https://github.com/proxysql/dbdeployer/blob/master/docs/API/API-1.16.md Displays syntax and examples for tools installed in database sandboxes. Can specify 'single' or 'multiple' for specific examples. ```bash $ dbdeployer usage [single|multiple] [flags] ``` -------------------------------- ### Show Usage Syntax and Examples Source: https://github.com/proxysql/dbdeployer/blob/master/docs/API/API-1.31.md Displays syntax and examples for dbdeployer tools installed in database sandboxes. Can specify 'single' or 'multiple' for specific tool usage. ```bash $ dbdeployer usage -h ``` ```bash $ dbdeployer usage [single|multiple] [flags] ``` -------------------------------- ### Install dbdeployer using gobinaries.com Source: https://github.com/proxysql/dbdeployer/blob/master/docs/wiki/installation.md Install dbdeployer using the gobinaries.com service, which can install any Go tool. This command fetches and executes the installation. ```bash $ curl -sf https://gobinaries.com/ProxySQL/dbdeployer | sh ``` -------------------------------- ### Install dbdeployer via gobinaries.com Source: https://github.com/proxysql/dbdeployer/blob/master/mkwiki/full_doc.markdown Install dbdeployer using the gobinaries.com service, which can install any Go tool. ```bash $ curl -sf https://gobinaries.com/datacharmer/dbdeployer | sh ``` -------------------------------- ### Start MySQL Server with Options Source: https://github.com/proxysql/dbdeployer/blob/master/docs/wiki/sandbox-management.md Use the './start' script within a sandbox directory to start the MySQL server. You can pass server-specific options as arguments. ```bash ./start --server-id=1001 ``` -------------------------------- ### Deploy single sandbox with --skip-start Source: https://github.com/proxysql/dbdeployer/blob/master/docs/wiki/skip-server-start.md Initializes a single instance without starting it, requiring manual start and grant loading. ```bash $ dbdeployer deploy single --skip-start 5.7.21 $ $HOME/sandboxes/msb_5_7_21/start $ $HOME/sandboxes/msb_5_7_21/load_grants ``` -------------------------------- ### GET /usage Source: https://github.com/proxysql/dbdeployer/blob/master/docs/API/API-1.12.md Displays syntax and examples for tools installed in database sandboxes. ```APIDOC ## GET /usage ### Description Shows syntax and examples of tools installed in database sandboxes. ### Method GET ### Endpoint dbdeployer usage [single|multiple] ### Parameters #### Path Parameters - **type** (string) - Optional - The type of deployment (single or multiple) ``` -------------------------------- ### Global Start Command Source: https://github.com/proxysql/dbdeployer/blob/master/docs/API/API-1.2.md Starts all sandboxes managed by dbdeployer. ```bash dbdeployer global start ``` -------------------------------- ### CLI Command: usage Source: https://github.com/proxysql/dbdeployer/blob/master/docs/API/API-1.29.md Displays syntax and examples for tools installed within database sandboxes. ```APIDOC ## usage ### Description Shows syntax and examples of tools installed in database sandboxes. ### Usage dbdeployer usage [single|multiple] [flags] ### Parameters #### Path Parameters - **type** (string) - Optional - The type of deployment (single or multiple). ``` -------------------------------- ### dbdeployer global start command usage Source: https://github.com/proxysql/dbdeployer/blob/master/docs/API/API-1.61.md Starts all managed sandboxes. Use this command to bring all instances online. ```bash $ dbdeployer global start [options] [flags] ``` -------------------------------- ### dbdeployer global start Source: https://github.com/proxysql/dbdeployer/blob/master/docs/API/API-1.42.md Starts all sandboxes. ```APIDOC ## dbdeployer global start ### Description Starts all sandboxes. ### Method Not applicable (CLI command) ### Endpoint Not applicable (CLI command) ### Usage ``` dbdeployer global start [options] [flags] ``` ### Flags - **-h, --help** (bool) - help for start ``` -------------------------------- ### dbdeployer global start Source: https://github.com/proxysql/dbdeployer/blob/master/docs/API/API-1.41.md Starts all sandboxes. ```APIDOC ## dbdeployer global start ### Description Starts all sandboxes. ### Usage dbdeployer global start [options] [flags] ### Flags -h, --help help for start ``` -------------------------------- ### Show Tool Usage Source: https://github.com/proxysql/dbdeployer/blob/master/docs/API/API-1.10.md Displays syntax and examples for tools installed in database sandboxes. Can specify 'single' or 'multiple' for targeted usage information. ```bash dbdeployer usage -h ``` ```bash dbdeployer usage [single|multiple] [flags] ``` -------------------------------- ### Start all sandboxes Source: https://github.com/proxysql/dbdeployer/blob/master/docs/API/API-1.37.md Starts all existing sandboxes. ```bash $ dbdeployer global start -h ``` -------------------------------- ### Deploy replication sandbox with --skip-start Source: https://github.com/proxysql/dbdeployer/blob/master/docs/wiki/skip-server-start.md Initializes a replication topology without starting, requiring manual start, master grant loading, and slave initialization. ```bash $ dbdeployer deploy replication --skip-start 5.7.21 --concurrent $ $HOME/sandboxes/rsandbox_5_7_21/start_all $ $HOME/sandboxes/rsandbox_5_7_21/master/load_grants # NOTE: only the master needs to load grants. The slaves receive the grants through replication $ $HOME/sandboxes/rsandbox_5_7_21/initialize_slaves ``` -------------------------------- ### Global Sandbox Start Source: https://github.com/proxysql/dbdeployer/blob/master/docs/API/API-1.42.md Starts all sandboxes. Essential for bringing all environments online. ```bash dbdeployer global start [options] [flags] ``` -------------------------------- ### Install dbdeployer via bit.ly shortcut Source: https://github.com/proxysql/dbdeployer/blob/master/docs/wiki/installation.md Use a shortened bit.ly URL to download and execute the dbdeployer installation script. ```bash $ curl -L -s https://bit.ly/dbdeployer | bash ``` -------------------------------- ### Start all sandboxes Source: https://github.com/proxysql/dbdeployer/blob/master/docs/API/API-1.21.md Initiates the startup process for all sandboxes. ```bash $ dbdeployer global start ``` -------------------------------- ### Deploy group replication sandbox with --skip-start Source: https://github.com/proxysql/dbdeployer/blob/master/docs/wiki/skip-server-start.md Initializes a group replication topology without starting, requiring manual start, individual node grant loading, and node initialization. ```bash $ dbdeployer deploy replication --skip-start 5.7.21 --topology=group --concurrent $ $HOME/sandboxes/group_msb_5_7_21/start_all $ $HOME/sandboxes/group_msb_5_7_21/node1/load_grants $ $HOME/sandboxes/group_msb_5_7_21/node2/load_grants $ $HOME/sandboxes/group_msb_5_7_21/node3/load_grants $ $HOME/sandboxes/rsandbox_5_7_21/initialize_nodes ``` -------------------------------- ### Install golangci-lint Source: https://github.com/proxysql/dbdeployer/blob/master/CONTRIBUTING.md Install the golangci-lint tool, which is required for linting dbdeployer code. Ensure Go 1.22+ is installed. ```bash go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest ``` -------------------------------- ### Manual dbdeployer Installation Source: https://github.com/proxysql/dbdeployer/blob/master/mkwiki/full_doc.markdown Manually install dbdeployer by downloading the binary, making it executable, and moving it to a directory in your $PATH. ```bash $ VERSION=1.66.0 $ OS=linux $ origin=https://github.com/datacharmer/dbdeployer/releases/download/v$VERSION $ wget $origin/dbdeployer-$VERSION.$OS.tar.gz $ tar -xzf dbdeployer-$VERSION.$OS.tar.gz $ chmod +x dbdeployer-$VERSION.$OS $ sudo mv dbdeployer-$VERSION.$OS /usr/local/bin/dbdeployer ``` -------------------------------- ### dbdeployer Command Usage Examples Source: https://github.com/proxysql/dbdeployer/blob/master/website/src/content/docs/reference/cli-commands.md Examples demonstrating the use of dbdeployer command-line completion to explore available commands and options. ```bash dbdeployer [tab] ``` ```bash dbdeployer dep[tab] ``` ```bash dbdeployer deploy [tab][tab] ``` ```bash dbdeployer deploy s[tab] ``` ```bash dbdeployer deploy single --b[tab][tab] ``` -------------------------------- ### Start and Load Grants for Skipped Deployment Source: https://github.com/proxysql/dbdeployer/blob/master/mkreadme/readme_template.md Manually starts a sandbox deployed with --skip-start and loads grants. For replication, slaves receive grants via replication. ```bash $ $HOME/sandboxes/msb_5_7_21/start $ $HOME/sandboxes/msb_5_7_21/load_grants ``` -------------------------------- ### Hybrid Replication Examples Source: https://github.com/proxysql/dbdeployer/blob/master/docs/wiki/replication-between-sandboxes.md Demonstrates hybrid replication scenarios using the `replicate_from` script. These examples show replication between different topology types. ```bash # group replication to single ~/sandboxes/msb_8_0_15/replicate_from group_8_0_15_2 ``` ```bash # single to master/slave ~/sandboxes/ms_8_0_15_1/replicate_from msb_8_0_15 ``` ```bash # master/slave to group ~/sandboxes/group_8_0_15_2/replicate_from ms_8_0_15_1 ``` -------------------------------- ### Global Command Usage Examples Source: https://github.com/proxysql/dbdeployer/blob/master/docs/API/API-1.34.md Demonstrates how to use the 'global' command to propagate actions across all sandboxes. Examples include running a query, checking status, and stopping sandboxes. ```bash $ dbdeployer global use "select version()" ``` ```bash $ dbdeployer global status ``` ```bash $ dbdeployer global stop ``` -------------------------------- ### Install PostgreSQL System-wide and Copy Binaries Source: https://github.com/proxysql/dbdeployer/blob/master/website/src/content/docs/providers/postgresql.md Installs PostgreSQL system-wide using apt, stops the service, and copies binaries to dbdeployer's expected layout. This is the simplest approach for obtaining binaries. ```bash sudo apt-get install postgresql-16 postgresql-client-16 sudo systemctl stop postgresql PG_FULL=$(dpkg -s postgresql-16 | grep '^Version:' | sed 's/Version: //' | cut -d'-' -f1) mkdir -p ~/opt/postgresql/${PG_FULL}/{bin,lib,share} cp -a /usr/lib/postgresql/16/bin/. ~/opt/postgresql/${PG_FULL}/bin/ cp -a /usr/lib/postgresql/16/lib/. ~/opt/postgresql/${PG_FULL}/lib/ cp -a /usr/share/postgresql/16/. ~/opt/postgresql/${PG_FULL}/share/ ``` -------------------------------- ### dbdeployer usage Source: https://github.com/proxysql/dbdeployer/blob/master/docs/API/API-1.37.md Displays syntax and examples for tools installed within database sandboxes. It can be used to get usage information for single or multiple deployments. ```APIDOC ## GET /dbdeployer/usage ### Description Displays syntax and examples for tools installed within database sandboxes. It can be used to get usage information for single or multiple deployments. ### Method GET ### Endpoint /dbdeployer/usage ### Parameters #### Query Parameters - **type** (string) - Optional - Specifies the type of usage information to retrieve ('single' or 'multiple'). Defaults to general usage if not specified. ### Response #### Success Response (200) - **usage_info** (string) - A string containing the syntax and examples for the requested usage type. #### Response Example ```json { "usage_info": "Usage for single deployments: dbdeployer deploy single [options]..." } ``` ``` -------------------------------- ### View dbdeployer init help Source: https://github.com/proxysql/dbdeployer/blob/master/docs/wiki/initializing-the-environment.md Displays usage information and available flags for the init command. ```bash $ dbdeployer init -h Initializes dbdeployer environment: * creates $SANDBOX_HOME and $SANDBOX_BINARY directories * downloads and expands the latest MySQL tarball * installs shell completion file Usage: dbdeployer init [flags] Flags: --dry-run Show operations but don't run them -h, --help help for init --skip-all-downloads Do not download any file (skip both MySQL tarball and shell completion file) --skip-shell-completion Do not download shell completion file --skip-tarball-download Do not download MySQL tarball ``` -------------------------------- ### Generate dbdeployer Cookbook Scripts Source: https://github.com/proxysql/dbdeployer/blob/master/mkreadme/readme_template.md Use `dbdeployer cookbook create ` to generate sample deployment scripts. For example, `dbdeployer cookbook create single` creates a `single-deployment.sh` script in the `./recipes` directory. If no versions are found, a `prerequisites.sh` script will guide you on necessary setup. ```bash dbdeployer cookbook list ``` ```bash dbdeployer cookbook create single ``` ```bash dbdeployer cookbook create ALL ``` -------------------------------- ### GET /sandboxes Source: https://github.com/proxysql/dbdeployer/blob/master/docs/API/API-1.54.md Lists all sandboxes installed in the system. ```APIDOC ## GET /sandboxes ### Description Lists all sandboxes installed in $SANDBOX_HOME or via the catalog. ### Method GET ### Endpoint dbdeployer sandboxes ### Parameters #### Query Parameters - **--by-date** (flag) - Optional - Show sandboxes in order of creation - **--by-flavor** (flag) - Optional - Show sandboxes sorted by flavor - **--by-version** (flag) - Optional - Show sandboxes sorted by version - **--catalog** (flag) - Optional - Use sandboxes catalog instead of scanning directory - **--full-info** (flag) - Optional - Shows all info in table format - **--latest** (flag) - Optional - Show only latest sandbox - **--oldest** (flag) - Optional - Show only oldest sandbox ``` -------------------------------- ### Display sandbox usage instructions Source: https://github.com/proxysql/dbdeployer/blob/master/mkwiki/wiki_template.markdown Shows how to use the scripts installed with each sandbox. ```bash {{dbdeployer usage}} ``` -------------------------------- ### GET sandboxes Source: https://github.com/proxysql/dbdeployer/blob/master/docs/API/API-1.53.md Lists all sandboxes installed in the system. ```APIDOC ## GET sandboxes ### Description Lists all sandboxes installed in $SANDBOX_HOME. ### Method GET ### Endpoint dbdeployer sandboxes ### Parameters #### Query Parameters - **--by-date** (flag) - Optional - Show sandboxes in order of creation - **--by-flavor** (flag) - Optional - Show sandboxes sorted by flavor - **--by-version** (flag) - Optional - Show sandboxes sorted by version - **--catalog** (flag) - Optional - Use sandboxes catalog instead of scanning directory - **--flavor** (flag) - Optional - Shows flavor in sandbox list - **--full-info** (flag) - Optional - Shows all info in table format - **--header** (flag) - Optional - Shows header with catalog output - **--latest** (flag) - Optional - Show only latest sandbox - **--oldest** (flag) - Optional - Show only oldest sandbox - **--table** (flag) - Optional - Shows sandbox list as a table ``` -------------------------------- ### Build dbdeployer with documentation Source: https://github.com/proxysql/dbdeployer/blob/master/docs/wiki/compiling-dbdeployer.md Build the binaries with documentation enabled by setting the MKDOCS environment variable. ```bash MKDOCS=1 ./scripts/build.sh {linux|OSX} ``` -------------------------------- ### dbdeployer usage Source: https://github.com/proxysql/dbdeployer/blob/master/docs/API/API-1.10.md Shows syntax and examples of tools installed in database sandboxes. ```APIDOC ## dbdeployer usage ### Description Shows syntax and examples of tools installed in database sandboxes. ### Method CLI Command ### Endpoint dbdeployer usage [single|multiple] [flags] ### Parameters #### Path Parameters - **type** (string) - Optional - Specifies the type of usage to display (e.g., 'single', 'multiple'). #### Query Parameters - **h** (boolean) - Optional - help for usage. - **help** (boolean) - Optional - help for usage. ### Request Example ```bash dbdeployer usage single ``` ### Response #### Success Response (200) - **syntax** (string) - The syntax for the specified usage type. - **examples** (array) - A list of examples for the specified usage type. ``` -------------------------------- ### dbdeployer usage Source: https://github.com/proxysql/dbdeployer/blob/master/docs/API/API-1.21.md Displays syntax and examples for tools installed within database sandboxes. ```APIDOC ## GET /dbdeployer/usage ### Description Retrieves syntax and usage examples for tools available in database sandboxes. ### Method GET ### Endpoint /dbdeployer/usage ### Parameters #### Query Parameters - **type** (string) - Optional - Specifies the type of usage to display (e.g., 'single' or 'multiple'). ### Response #### Success Response (200) - **usage_info** (string) - A string containing the usage syntax and examples. #### Response Example ```json { "usage_info": "Usage: dbdeployer usage [single|multiple] [flags]\nShows syntax and examples of tools installed in database sandboxes." } ``` ``` -------------------------------- ### Initialize dbdeployer Environment Source: https://context7.com/proxysql/dbdeployer/llms.txt Set up the local directory structure and manage initial downloads. ```bash # Full initialization with MySQL download dbdeployer init # Initialize for PostgreSQL (shows setup instructions) dbdeployer init --provider=postgresql # Initialize without downloading anything dbdeployer init --skip-all-downloads # Dry run to see what would happen dbdeployer init --dry-run ``` -------------------------------- ### Initialize dbdeployer environment Source: https://github.com/proxysql/dbdeployer/blob/master/docs/wiki/initializing-the-environment.md Run this command to create necessary directories and download the latest MySQL binaries. ```bash $ dbdeployer init ``` -------------------------------- ### dbdeployer usage Source: https://github.com/proxysql/dbdeployer/blob/master/docs/API/API-1.19.md Displays syntax and examples for tools installed within database sandboxes. ```APIDOC ## GET /dbdeployer/usage ### Description Shows syntax and examples of tools installed in database sandboxes. ### Method GET ### Endpoint /dbdeployer/usage ### Parameters #### Query Parameters - **type** (string) - Optional - Specifies the type of usage to display (e.g., 'single' or 'multiple'). ### Response #### Success Response (200) - **usage_info** (string) - Detailed usage information and examples. #### Response Example ```json { "usage_info": "Usage: dbdeployer usage [single|multiple] [flags]\nShows syntax and examples of tools installed in database sandboxes." } ``` ``` -------------------------------- ### Manage Cookbook Samples Source: https://github.com/proxysql/dbdeployer/blob/master/docs/API/API-1.58.md Commands for interacting with dbdeployer cookbook samples, including creating, listing, and showing them. ```bash dbdeployer cookbook ``` ```bash dbdeployer cookbook create ``` ```bash dbdeployer cookbook list ``` ```bash dbdeployer cookbook show ``` -------------------------------- ### GET /sandboxes Source: https://github.com/proxysql/dbdeployer/blob/master/docs/API/API-1.12.md Lists all sandboxes installed in the sandbox home directory or via the catalog. ```APIDOC ## GET /sandboxes ### Description Lists all sandboxes installed in $SANDBOX_HOME. Alternatively, use the --catalog flag to list all sandboxes regardless of deployment location. ### Method GET ### Endpoint dbdeployer sandboxes ### Parameters #### Query Parameters - **--catalog** (boolean) - Optional - Use sandboxes catalog instead of scanning directory - **--header** (boolean) - Optional - Shows header with catalog output - **--sandbox-home** (string) - Optional - Specify custom directory to look for sandboxes ``` -------------------------------- ### Display Dbdeployer Usage Source: https://github.com/proxysql/dbdeployer/blob/master/docs/API/API-1.2.md Shows syntax and examples of tools installed in database sandboxes. Accepts 'single' or 'multiple' as arguments. ```bash dbdeployer usage [single|multiple] [flags] ``` -------------------------------- ### dbdeployer usage Source: https://github.com/proxysql/dbdeployer/blob/master/docs/API/API-1.30.md Displays syntax and examples for tools installed within database sandboxes. Can specify 'single' or 'multiple' for targeted usage information. ```APIDOC ## usage ### Description Shows syntax and examples of tools installed in database sandboxes. ### Usage dbdeployer usage [single|multiple] [flags] ### Flags - -h, --help help for usage ``` -------------------------------- ### View tool usage and versions Source: https://github.com/proxysql/dbdeployer/blob/master/docs/API/API-1.17.md Commands to display syntax examples for sandboxes and list available database versions. ```bash $ dbdeployer usage -h ``` ```bash $ dbdeployer versions -h ``` -------------------------------- ### Replication attempts and success Source: https://github.com/proxysql/dbdeployer/blob/master/docs/wiki/replication-between-sandboxes.md Examples of failed replication attempts due to missing binlogs or version mismatch, followed by a successful replication setup. ```bash # Try replicating from the sandbox without binlogs and server ID. It fails $ ~/sandboxes/msb_5_7_25/replicate_from msb_5_6_41 No binlog information found in /Users/gmax/sandboxes/msb_5_6_41 # Try replicating from a master of a bigger version than the slave. It fails $ ~/sandboxes/msb_5_7_25/replicate_from msb_8_0_15 Master major version should be lower than slave version (or equal) # Try replicating from 5.7 to 8.0. It succeeds $ ~/sandboxes/msb_8_0_15/replicate_from msb_5_7_25 Connecting to /Users/gmax/sandboxes/msb_5_7_25 -------------- CHANGE MASTER TO master_host="127.0.0.1", master_port=5725, master_user="rsandbox", master_password="rsandbox" , master_log_file="mysql-bin.000001", master_log_pos=4089 -------------- -------------- start slave -------------- Master_Log_File: mysql-bin.000001 Read_Master_Log_Pos: 4089 Slave_IO_Running: Yes Slave_SQL_Running: Yes Exec_Master_Log_Pos: 4089 Retrieved_Gtid_Set: Executed_Gtid_Set: Auto_Position: 0 ``` -------------------------------- ### Run Circular Replication Example Source: https://github.com/proxysql/dbdeployer/blob/master/mkwiki/full_doc.markdown This recipe demonstrates how to set up circular replication between nodes in a multiple deployment. ```bash dbdeployer cookbook run circular_replication/circular-replication.sh ``` -------------------------------- ### Run Global Commands on Sandboxes Source: https://github.com/proxysql/dbdeployer/blob/master/docs/API/API-1.58.md Executes a given command across all installed sandboxes. Useful for batch operations like starting, stopping, or testing. ```bash dbdeployer global ``` ```bash dbdeployer global exec ``` ```bash dbdeployer global metadata ``` ```bash dbdeployer global restart ``` ```bash dbdeployer global start ``` ```bash dbdeployer global stop ``` ```bash dbdeployer global test ``` ```bash dbdeployer global test-replication ``` ```bash dbdeployer global use ``` -------------------------------- ### Display Help for a Specific Dbdeployer Command Source: https://github.com/proxysql/dbdeployer/blob/master/docs/API/API-1.30.md To get detailed information about a specific command, append '--help' to the command. For example, to see help for the 'admin' command. ```bash dbdeployer [command] --help ``` -------------------------------- ### Launch Admin UI Source: https://github.com/proxysql/dbdeployer/blob/master/website/src/content/docs/managing/admin-ui.md Starts the local web dashboard for managing sandboxes. ```bash dbdeployer admin ui ``` -------------------------------- ### Display Help for a Specific dbdeployer Command Source: https://github.com/proxysql/dbdeployer/blob/master/docs/API/API-1.39.md To get detailed help for a specific command, append '--help' to the command. For example, this shows usage information for the 'admin' command. ```bash dbdeployer admin --help ``` -------------------------------- ### Execute Global Commands on All Sandboxes Source: https://github.com/proxysql/dbdeployer/blob/master/mkreadme/readme_template.md Propagate a command to all installed sandboxes. This is useful for performing actions like checking status, starting, stopping, or testing all sandboxes simultaneously. Filters can be applied to limit the scope. ```bash dbdeployer global -h ``` -------------------------------- ### Install dbdeployer via Script (Direct) Source: https://github.com/proxysql/dbdeployer/blob/master/mkwiki/full_doc.markdown Install dbdeployer by piping the installation script directly to bash. This method downloads the latest version and installs it. ```bash $ curl -s https://raw.githubusercontent.com/datacharmer/dbdeployer/master/scripts/dbdeployer-install.sh | bash ``` -------------------------------- ### View All Capabilities Source: https://github.com/proxysql/dbdeployer/blob/master/mkwiki/wiki_template.markdown Use this command to see all supported database flavors and their general capabilities. ```shell $ dbdeployer admin capabilities ``` -------------------------------- ### Initialize dbdeployer environment Source: https://github.com/proxysql/dbdeployer/blob/master/docs/API/API-1.52.md Initializes the environment by creating directories and downloading necessary files. ```bash $ dbdeployer init -h ``` -------------------------------- ### Deploy with Custom Template Source: https://context7.com/proxysql/dbdeployer/llms.txt Deploy a MySQL sandbox using a custom start script template. Specify the version and the path to your custom script. ```bash dbdeployer deploy single 8.4.8 --use-template=start:/path/to/custom_start.sh ``` -------------------------------- ### CLI: deploy single Source: https://github.com/proxysql/dbdeployer/blob/master/docs/API/API-1.24.md Installs a single MySQL sandbox instance and creates utility scripts. ```APIDOC ## CLI Command: dbdeployer deploy single ### Description Installs a single sandbox instance. Requires an unpacked MySQL binary directory in the location defined by --sandbox-binary (default $HOME/opt/mysql). ### Parameters #### Positional Arguments - **MySQL-Version** (string) - Required - The version of MySQL to deploy (e.g., 5.7, 5.7.21) or a path to the binary directory. #### Flags - **--master** (bool) - Optional - Make the server replication ready. - **--prompt** (string) - Optional - Default prompt for the single client. Default: "mysql". ### Request Example $ dbdeployer deploy single 5.7.21 ``` -------------------------------- ### Install dbdeployer Source: https://github.com/proxysql/dbdeployer/blob/master/README.md Installs dbdeployer by piping the installation script to bash. Ensure you review scripts from untrusted sources before execution. ```bash curl -s https://raw.githubusercontent.com/ProxySQL/dbdeployer/master/scripts/dbdeployer-install.sh | bash ``` -------------------------------- ### CLI Command: dbdeployer init Source: https://github.com/proxysql/dbdeployer/blob/master/website/src/content/docs/reference/configuration.md Initializes the dbdeployer environment by creating directories, downloading binaries, and setting up shell completion. ```APIDOC ## CLI COMMAND: dbdeployer init ### Description Initializes the dbdeployer environment. This command creates the $SANDBOX_HOME and $SANDBOX_BINARY directories, downloads and expands the latest MySQL tarball, and installs shell completion files. ### Method CLI ### Endpoint dbdeployer init ### Parameters #### Flags - **--dry-run** (boolean) - Optional - Show operations but do not execute them. - **-h, --help** (boolean) - Optional - Display help for the init command. - **--skip-all-downloads** (boolean) - Optional - Do not download any files (skips MySQL tarball and shell completion). - **--skip-shell-completion** (boolean) - Optional - Do not download the shell completion file. - **--skip-tarball-download** (boolean) - Optional - Do not download the MySQL tarball. ``` -------------------------------- ### Manage Cookbook Samples Source: https://github.com/proxysql/dbdeployer/blob/master/docs/API/API-1.44.md The `cookbook` command group provides access to dbdeployer samples and recipes. Use `cookbook create` to generate sample configurations or `list` and `show` to view them. ```bash dbdeployer cookbook create ``` ```bash dbdeployer cookbook list ``` ```bash dbdeployer cookbook show ``` -------------------------------- ### Deploying a replication sandbox and loading sample data Source: https://github.com/proxysql/dbdeployer/blob/master/docs/wiki/loading-sample-data-into-sandboxes.md Deploys a replication sandbox and subsequently downloads and loads the employees sample database into it. ```bash $ dbdeployer deploy replication 8.0 --concurrent # 8.0 => 8.0.22 $HOME/sandboxes/rsandbox_8_0_22/initialize_slaves initializing slave 1 initializing slave 2 Replication directory installed in $HOME/sandboxes/rsandbox_8_0_22 run 'dbdeployer usage multiple' for basic instructions' $ dbdeployer data-load get employees rsandbox_8_0_22 downloading https://github.com/datacharmer/test_db/releases/download/v1.0.7/test_db-1.0.7.tar.gz .........10 MB.........21 MB.........32 MB... 36 MB Unpacking /Users/gmax/sandboxes/rsandbox_8_0_22/test_db-1.0.7.tar.gz ..26 Running /Users/gmax/sandboxes/rsandbox_8_0_22/load_db.sh INFO CREATING DATABASE STRUCTURE INFO storage engine: InnoDB INFO LOADING departments INFO LOADING employees INFO LOADING dept_emp INFO LOADING dept_manager INFO LOADING titles INFO LOADING salaries data_load_time_diff 00:00:57 ``` -------------------------------- ### Show cookbook create command help Source: https://github.com/proxysql/dbdeployer/blob/master/docs/API/API-1.40.md Displays help information for the 'create' subcommand within 'cookbook'. ```bash $ dbdeployer cookbook create -h ``` -------------------------------- ### Check Tool Installation Source: https://github.com/proxysql/dbdeployer/blob/master/website/src/content/docs/deploying/innodb-cluster.md Verify that mysqlsh and mysqlrouter are installed and accessible in your PATH. ```bash which mysqlsh mysqlrouter mysqlsh --version mysqlrouter --version ``` -------------------------------- ### Using Cookbook Recipes Source: https://github.com/proxysql/dbdeployer/blob/master/docs/API/API-1.34.md Commands for listing, creating, and displaying practical usage scripts for dbdeployer. ```bash dbdeployer cookbook -h ``` ```bash dbdeployer cookbook create -h ``` ```bash dbdeployer cookbook list -h ``` ```bash dbdeployer cookbook show -h ``` -------------------------------- ### Access help documentation Source: https://github.com/proxysql/dbdeployer/blob/master/mkwiki/wiki_template.markdown Use the --help flag to view command usage. ```bash dbdeployer downloads get --help dbdeployer downloads get-by-flavor --help ``` -------------------------------- ### Install dbdeployer via script Source: https://github.com/proxysql/dbdeployer/blob/master/mkwiki/wiki_template.markdown Use automated scripts to download and install the latest version of dbdeployer. ```bash $ curl -s https://raw.githubusercontent.com/datacharmer/dbdeployer/master/scripts/dbdeployer-install.sh | bash ``` ```bash $ curl -L -s https://bit.ly/dbdeployer | bash ``` ```bash $ curl -sf https://gobinaries.com/datacharmer/dbdeployer | sh ``` -------------------------------- ### Start MySQL Router Source: https://github.com/proxysql/dbdeployer/blob/master/website/src/content/docs/deploying/innodb-cluster.md Execute this script to start the MySQL Router instance associated with the deployed InnoDB Cluster. ```bash ~/sandboxes/ic_msb_8_4_8/router/router_start ``` -------------------------------- ### Sandbox Description File Example Source: https://github.com/proxysql/dbdeployer/blob/master/mkwiki/full_doc.markdown An example JSON structure for the sbdescription.json file, which contains metadata about a deployed sandbox. ```json { ``` -------------------------------- ### List Installed Sandboxes Source: https://github.com/proxysql/dbdeployer/blob/master/docs/wiki/sandbox-management.md Check which MySQL sandboxes have already been deployed on your system. Aliases 'installed' and 'deployed' can also be used. ```bash $ dbdeployer sandboxes # Aliases: installed, deployed ``` -------------------------------- ### Display Deploy Single Command Help Source: https://github.com/proxysql/dbdeployer/blob/master/mkreadme/readme_template.md View specific help for the `deploy single` subcommand to understand how to deploy a single MySQL sandbox. ```bash dbdeployer deploy single -h ``` -------------------------------- ### Show capabilities for all flavors Source: https://github.com/proxysql/dbdeployer/blob/master/docs/API/API-1.40.md Lists the capabilities of all supported database flavors. ```bash dbdeployer admin capabilities ``` -------------------------------- ### Start all sandboxes with flavor filtering Source: https://github.com/proxysql/dbdeployer/blob/master/docs/API/API-1.44.md Starts all sandboxes, with options to filter by flavor and type. A '!' prefix can be used to exclude flavors. ```bash $ dbdeployer global start --flavor=percona ``` ```bash $ dbdeployer global start --flavor='!percona' --type=single ``` -------------------------------- ### Manually initialize a group replication sandbox Source: https://github.com/proxysql/dbdeployer/blob/master/mkwiki/full_doc.markdown Steps to start and initialize nodes for a group replication topology deployed with --skip-start. ```bash $ dbdeployer deploy replication --skip-start 5.7.21 --topology=group --concurrent $ $HOME/sandboxes/group_msb_5_7_21/start_all $ $HOME/sandboxes/group_msb_5_7_21/node1/load_grants $ $HOME/sandboxes/group_msb_5_7_21/node2/load_grants $ $HOME/sandboxes/group_msb_5_7_21/node3/load_grants $ $HOME/sandboxes/rsandbox_5_7_21/initialize_nodes ``` -------------------------------- ### Command Help Documentation Source: https://github.com/proxysql/dbdeployer/blob/master/mkwiki/wiki_template.markdown Access help documentation for specific deployment commands. ```bash dbdeployer unpack -h ``` ```bash dbdeployer deploy -h ``` ```bash dbdeployer deploy single -h ``` ```bash dbdeployer deploy multiple -h ``` ```bash dbdeployer deploy replication -h ``` -------------------------------- ### Importing with Password from File Source: https://github.com/proxysql/dbdeployer/blob/master/website/src/content/docs/advanced/importing.md This example demonstrates importing a database where the password is provided via a file, useful for security or automation. ```bash $ dbdeployer import single db4free.net 3306 dbdeployer $(cat ~/.db4free.pwd) detected: 8.0.17 ``` -------------------------------- ### Manual dbdeployer Installation Source: https://github.com/proxysql/dbdeployer/blob/master/docs/wiki/installation.md Manually install dbdeployer by downloading the binary, extracting it, making it executable, and moving it to a directory in your system's PATH. ```bash $ VERSION=1.66.0 $ OS=linux $ origin=https://github.com/ProxySQL/dbdeployer/releases/download/v$VERSION $ wget $origin/dbdeployer-$VERSION.$OS.tar.gz $ tar -xzf dbdeployer-$VERSION.$OS.tar.gz $ chmod +x dbdeployer-$VERSION.$OS $ sudo mv dbdeployer-$VERSION.$OS /usr/local/bin/dbdeployer ``` -------------------------------- ### Dbdeployer Admin Upgrade Example Source: https://github.com/proxysql/dbdeployer/blob/master/docs/API/API-1.14.md Demonstrates how to upgrade a sandbox to a newer version using the 'admin upgrade' command. The target sandbox must already exist, and data will be migrated. ```bash dbdeployer admin upgrade msb_8_0_11 msb_8_0_12 ``` -------------------------------- ### Display replication deployment help Source: https://github.com/proxysql/dbdeployer/blob/master/docs/API/API-1.16.md Displays help for the replication deployment subcommand, which supports various topologies like master-slave and group replication. ```bash $ dbdeployer deploy replication -h ``` -------------------------------- ### List Installed Sandboxes Source: https://github.com/proxysql/dbdeployer/blob/master/docs/API/API-1.13.md Lists all sandboxes installed in $SANDBOX_HOME. Use --sandbox-home to specify a different location or --catalog to list from the catalog. ```bash $ dbdeployer sandboxes -h ``` -------------------------------- ### Import a single database server Source: https://github.com/proxysql/dbdeployer/blob/master/docs/wiki/importing-databases-into-sandboxes.md Use this command to create a sandbox for an existing database server by providing the host, port, and credentials. ```bash dbdeployer import single 192.168.0.164 5000 public nOtMyPassW0rd detected: 5.7.22 # Using client version 5.7.22 Database installed in $HOME/sandboxes/imp_msb_5_7_22 run 'dbdeployer usage single' for basic instructions' ``` ```bash $ dbdeployer import single db4free.net 3306 dbdeployer $(cat ~/.db4free.pwd) detected: 8.0.17 ```