[root@t-luhx02-v-szzb mysql]# dbdeployer downloads list Available tarballs () name OS version flavor size minimal -------------------------------------------------------- ------- --------- ------------- -------- --------- tidb-master-linux-amd64.tar.gz Linux 3.0.0 tidb 26 MB mysql-8.0.16-linux-glibc2.12-x86_64.tar.xz Linux 8.0.16 mysql 461 MB mysql-8.0.16-linux-x86_64-minimal.tar.xz Linux 8.0.16 mysql 44 MB Y mysql-5.7.27-linux-glibc2.12-x86_64.tar.gz Linux 5.7.27 mysql 645 MB mysql-8.0.17-linux-glibc2.12-x86_64.tar.xz Linux 8.0.17 mysql 480 MB mysql-8.0.17-linux-x86_64-minimal.tar.xz Linux 8.0.17 mysql 45 MB Y mysql-5.7.26-linux-glibc2.12-x86_64.tar.gz Linux 5.7.26 mysql 645 MB mysql-5.6.44-linux-glibc2.12-x86_64.tar.gz Linux 5.6.44 mysql 329 MB mysql-5.5.62-linux-glibc2.12-x86_64.tar.gz Linux 5.5.62 mysql 199 MB mysql-8.0.15-linux-glibc2.12-x86_64.tar.xz Linux 8.0.15 mysql 376 MB mysql-8.0.13-linux-glibc2.12-x86_64.tar.xz Linux 8.0.13 mysql 394 MB mysql-5.7.25-linux-glibc2.12-x86_64.tar.gz Linux 5.7.25 mysql 645 MB mysql-5.6.43-linux-glibc2.12-x86_64.tar.gz Linux 5.6.43 mysql 329 MB mysql-5.5.61-linux-glibc2.12-x86_64.tar.gz Linux 5.5.61 mysql 199 MB mysql-5.1.73-linux-x86_64-glibc23.tar.gz Linux 5.1.73 mysql 134 MB mysql-5.0.96.tar.xz Linux 5.0.96 mysql 5.5 MB Y mysql-5.1.72.tar.xz Linux 5.1.72 mysql 10 MB Y mysql-5.5.61.tar.xz Linux 5.5.61 mysql 6.6 MB Y mysql-5.5.62.tar.xz Linux 5.5.62 mysql 6.6 MB Y mysql-5.6.43.tar.xz Linux 5.6.43 mysql 9.0 MB Y mysql-5.6.44.tar.xz Linux 5.6.44 mysql 9.1 MB Y mysql-5.7.25.tar.xz Linux 5.7.25 mysql 23 MB Y mysql-5.7.26.tar.xz Linux 5.7.26 mysql 23 MB Y mysql-5.0.96-linux-x86_64-glibc23.tar.gz Linux 5.0.96 mysql 127 MB mysql-4.1.22.tar.xz Linux 4.1.22 mysql 4.6 MB Y mysql-cluster-gpl-7.6.10-linux-glibc2.12-x86_64.tar.gz Linux 7.6.10 ndb 916 MB mysql-cluster-8.0.16-dmr-linux-glibc2.12-x86_64.tar.gz Linux 8.0.16 ndb 1.1 GB mysql-cluster-gpl-7.6.11-linux-glibc2.12-x86_64.tar.gz Linux 7.6.11 ndb 916 MB mysql-cluster-8.0.17-rc-linux-glibc2.12-x86_64.tar.gz Linux 8.0.17 ndb 1.1 GB mysql-shell-8.0.17-linux-glibc2.12-x86-64bit.tar.gz Linux 8.0.17 mysql-shell 30 MB mysql-5.7.28-linux-glibc2.12-x86_64.tar.gz Linux 5.7.28 mysql 725 MB mysql-8.0.18-linux-glibc2.12-x86_64.tar.xz Linux 8.0.18 mysql 504 MB mysql-8.0.18-linux-x86_64-minimal.tar.xz Linux 8.0.18 mysql 48 MB Y mysql-8.0.19-linux-x86_64-minimal.tar.xz Linux 8.0.19 mysql 45 MB mysql-cluster-8.0.19-linux-glibc2.12-x86_64.tar.gz Linux 8.0.19 ndb 1.2 GB mysql-5.7.29-linux-glibc2.12-x86_64.tar.gz Linux 5.7.29 mysql 665 MB
[root@t-luhx02-v-szzb mysql]# cd /media/mysql [root@t-luhx02-v-szzb mysql]# dbdeployer unpack mysql-5.6.46-linux-glibc2.12-x86_64.tar.gz
测试实例
[root@t-luhx02-v-szzb mysql]# dbdeployer deploy single 5.6.46 --gtid --my-cnf-options="character_set_server=utf8mb4" --db-user=msandbox --db-password=Abcd123# Database installed in /usr/local/bin/msb_5_6_46 run 'dbdeployer usage single' for basic instructions' . sandbox server started
连接实例
[root@t-luhx02-v-szzb mysql]# mysql -uroot -p -h 127.0.0.1 -P5646
也可以进入实例数据目录通过use连接
[root@t-luhx02-v-szzb msb_5_6_46]# ./use -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 4 Server version: 5.6.46-log MySQL Community Server (GPL)
Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql [localhost:5646] {msandbox} ((none)) >
查看已安装的环境
[root@t-luhx02-v-szzb mysql]# dbdeployer sandboxes --full-info .------------.--------.---------.-----------.---------.--------.-------.--------. | name | type | version | host | port | flavor | nodes | locked | +------------+--------+---------+-----------+---------+--------+-------+--------+ | msb_5_6_46 | single | 5.6.46 | 127.0.0.1 | [5646 ] | mysql | 0 |
查看运行状态
[root@t-luhx02-v-szzb mysql]# dbdeployer global status # Running "status" on msb_5_6_46 msb_5_6_46 on
重启实例
[root@t-luhx02-v-szzb ~]# dbdeployer global stop msb_5_6_46 # Running "stop" on msb_5_6_46 stop /usr/local/bin/msb_5_6_46
[root@t-luhx02-v-szzb ~]# dbdeployer global start msb_5_6_46 # Running "start" on msb_5_6_46
删除实例
[root@t-luhx02-v-szzb ~]# dbdeployer delete msb_5_6_46 List of deployed sandboxes: /usr/local/bin/msb_5_6_46 Running /usr/local/bin/msb_5_6_46/stop Running rm -rf /usr/local/bin/msb_5_6_46 Directory /usr/local/bin/msb_5_6_46 deleted