April 13, 2022

mysqlserverclone usage in MySQL

MySQL mysqlserverclone utility commands

mysqlserverclone  start another instance of a running server 

mysqlserverclone utility, in MySQL, enables DBAs to clone an existing MySQL server instance to create a new server instance on the same host (does not copy any data).

Usage: mysqlserverclone --server=user:pass@host:port:socket --new-data=/tmp/data2 --new-port=3310 --new-id=12 --root-password=root

mysqlserverclone --help
mysqlserverclone --version

mysqlserverclone --new-port=3310 --server=root:pass@localhost --new-data=/source/test123
mysqlserverclone --new-port=3310 --server=mysql_dba --new-data=/source/test123
mysqlserverclone --new-port=3310 --server=root:pass@localhost --new-data=/source/test123 --root-password=pass --mysqld=--log-bin=mysql-bin

mysqlserverclone --server=root:pass@localhost --new-data=/source/test123 --new-port=3310 --root-password=pass --mysqld=--log-bin=mysql-bin --quiet
mysqlserverclone --new-port=3310 --server=mysql_dba --new-data=/source/test123 --verbose

mysqlserverclone --server=root:mysql@localhost:3306 --new-data="C:/Users/store" --mysqld="--server-id=2 --log-bin --log-slave-updates --gtid-mode=ON --enforce-gtid-consistency" --new-port=13000 --delete-data
mysqlserverclone --basedir=/source/mysql-5.6--new-data=/source/temp_3009 --new-port=3009 --new-id=101 --root=root --mysqld="--log-bin --gtid-mode=on --log-slave-updates --enforce-gtid-consistency --master-info-repository=table --report-host=localhost --report-port=3009" --delete-data

mysqlserverclone Options:
  --version             show program's version number and exit
  --help                 display a help message and exit
  --license             display program's license and exit
  --server=SERVER       connection information for the server in the form: user[:password]@host[:port][:socket] or login-path[:port][:socket] or config- path[[group]].

  --ssl-ca=SSL_CA         path to a file that contains a list of trusted SSL CAs.
  --ssl-cert=SSL_CERT   name of the SSL certificate file to use for   establishing a secure connection.
  --ssl-key=SSL_KEY     name of the SSL key file to use for establishing a secure connection.
  --ssl=SSL                   specifies if the server connection requires use of SSL. If an encrypted connection cannot be established, the connection attempt fails. By default 0 (SSL not required).

  --new-data=NEW_DATA   the full path to the location of the data directory for the new instance. The path size must be smaller or equal than 200 characters.
  --new-port=NEW_PORT   the new port for the new instance - default=3307
  --new-id=NEW_ID           the server_id for the new instance - default=2
  --root-password=ROOT_PASS    password for the root user
  --mysqld=MYSQLD          additional options for mysqld

  -w CMD_FILE, --write-command=CMD_FILE  path to file for writing startup command. For example: start_server1.sh
  -v, --verbose         control how much information is displayed. e.g., -v = verbose, -vv = more verbose, -vvv = debug
  -q, --quiet            turn off all messages for quiet execution.
  --basedir=BASEDIR     the base directory for the server
  --delete-data         delete the folder specified by --new-data if it exists and is not empty.

  --user=USER         user account to launch cloned server. Default is current user.
  --start-timeout=START_TIMEOUT    Number of seconds to wait for server to start. Default = 10.
  --force                  Ignore the maximum path length and the low space checks for the --new-data option.


Related MySQL Articles: MySQL mysqluserclone utility cheatsheet   
mysql_install_db utility commands in MySQL

No comments:

Post a Comment