MySQL Shell 工具安装使用

发布时间 2023-03-29 11:35:47作者: __Yoon

详解转载:

https://www.xmmup.com/mysql-shellgongjujieshao.html

下载:

wget https://dev.mysql.com/get/Downloads/MySQL-Shell/mysql-shell-8.0.29-linux-glibc2.12-x86-64bit.tar.gz

安装:

tar xvf mysql-shell-8.0.29-linux-glibc2.12-x86-64bit.tar.gz -C /usr/local/

ln -s /usr/local/mysql-shell-8.0.29-linux-glibc2.12-x86-64bit /usr/local/mysql-shell

配置环境变量:

export PATH=$PATH:/usr/local/mysql-shell/bin

echo "export PATH=$PATH:/usr/local/mysql-shell/bin" >> /root/.bashrc

source /root/.bashrc

帮助:

[root@hankyoon ]# mysqlsh --help

Usage examples:
$ mysqlsh root@localhost/schema

$ mysqlsh mysqlx://root@some.server:3307/world_x

$ mysqlsh --uri root@localhost --py -f sample.py sample param $ mysqlsh root@targethost:33070 -s world_x -f sample.js

$ mysqlsh -- util check-for-server-upgrade root@localhost --output-format=JSON

$ mysqlsh mysqlx://user@host/db --import ~/products.json shop