首页 > 系统相关 >MariaDB 工具介绍之 mariadb-shell

MariaDB 工具介绍之 mariadb-shell

时间:2023-06-23 21:31:50浏览次数:45  
标签:shell 23.03 MariaDB flush test mariadb el7

MariaDB Shell是一个命令行工具,它统一了MariaDB数据库产品的故障排除和管理。 MariaDB Shell 23.03.2于2023-05-05发布。 这个版本是一个技术预览版,不应该在生产环境中使用。

安装

通过页面 https://mariadb.com/downloads/tools/ 下载安装包 将安装包上传至服务器后,直接进行 yum 安装,输出如下:

$ sudo yum install mariadb-shell-23.03-2.el7.x86_64.rpm
Loaded plugins: changelog, fastestmirror, product-id, search-disabled-repos, subscription-manager, verify

This system is not registered with an entitlement server. You can use subscription-manager to register.

Examining mariadb-shell-23.03-2.el7.x86_64.rpm: mariadb-shell-23.03-2.el7.x86_64
Marking mariadb-shell-23.03-2.el7.x86_64.rpm to be installed
Resolving Dependencies
There are unfinished transactions remaining. You might consider running yum-complete-transaction, or "yum-complete-transaction --cleanup-only" and "yum history redo last", first to finish them. If those don't work you'll have to try removing/installing packages by hand (maybe package-cleanup can help).
--> Running transaction check
---> Package mariadb-shell.x86_64 0:23.03-2.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

==================================================================================================================================================================================================================================
Package                                             Arch                                         Version                                           Repository                                                               Size
==================================================================================================================================================================================================================================
Installing:
mariadb-shell                                       x86_64                                       23.03-2.el7                                       /mariadb-shell-23.03-2.el7.x86_64                                       213 M

Transaction Summary
==================================================================================================================================================================================================================================
Install  1 Package

Total size: 213 M
Installed size: 213 M
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : mariadb-shell-23.03-2.el7.x86_64                                                                                                                                                                               1/1
  Verifying  : mariadb-shell-23.03-2.el7.x86_64                                                                                                                                                                               1/1
Installed:
  mariadb-shell.x86_64 0:23.03-2.el7

Complete!

msh

msh 提供了若干命令,演示如下, 查看版本信息:

MariaDB (test) ? sys version
MariaDB Shell 23.03.2
Copyright (c) 2022 MariaDB plc and others.
MariaDB Server version: 10.11.3-MariaDB
Connection method:      localhost using socket
UNIX socket used:       /var/lib/mysql/mysql.sock

Uptime:                 13 days, 22:53:34
Threads Created:        10
Questions:              57423
Opened Tables:          157
Open Tables:            124
Queries per second ave: 0.047630

查看当前表:

MariaDB (test) ? ls
┌────────────────┐
│ Tables_in_test │
├────────────────┤
│ a              │
│ t1             │
│ t12            │
│ t_inet4        │
│ t_uuid         │
│ test_insert_id │
└────────────────┘
7 rows in set (0.001258).

MariaDB (test) ? dir
┌────────────────┐
│ Tables_in_test │
├────────────────┤
│ a              │
│ t1             │
│ t12            │
│ t_inet4        │
│ t_uuid         │
│ test_insert_id │
└────────────────┘
7 rows in set (0.000777).

可以将输出格式转为 sqlplus :

MariaDB (test) ? output sqlplus
Output format changed to sqlplus

MariaDB (test) ? ls
Tables_in_test
--------------------
a
t1
t12
t_inet4
t_uuid
test_insert_id
6 rows in set (0.000960).

MariaDB Shell的第一个版本有一些很棒的新特性,比如能够在内存存储引擎缓存中预热,比如InnoDB缓冲池。

MariaDB (test) ? warm t1
Warning: Large tables will take a significant amount of time to warm.
test.t1 has been read into memory.
MariaDB (test) ? warm
Warning: Large tables will take a significant amount of time to warm.
test.t_inet4 has been read into memory.
test.t_uuid has been read into memory.
test.t12 has been read into memory.
test.t1 has been read into memory.
test.a has been read into memory.
test.test_insert_id has been read into memory.

当然,msh 还提供了若干系统命令,命令列表如下:

MariaDB (test) ? sys

ADMIN, SYS or SYSTEM commands are the gateway to all things administration-management for MariaDB products.

Currently available commands for this tool are:

create, drop, shutdown, reload, refresh, version, processlist, status, kill, debug, variables, flush-logs, flush-hosts, flush-tables, password, ping, extended-status, replication-status, replica-status, all-replication-status, all-replica-status, flush-status, flush-privileges, start-slave, stop-slave, start-all-slaves, stop-all-slaves, start-replica, stop-replica, start-all-replicas, stop-all-replicas, flush-threads, old-password, flush-binary-log, flush-engine-log, flush-error-log, flush-general-log, flush-relay-log, flush-slow-log, flush-table-statistics, flush-index-statistics, flush-user-statistics, flush-client-statistics, flush-user-resources, flush-all-status, flush-all-statistics, flush-ssl, load-buffer-pool, dump-buffer-pool, memory-config, pre-slice

标签:shell,23.03,MariaDB,flush,test,mariadb,el7
From: https://blog.51cto.com/u_15081581/6539125

相关文章

  • xshell 常用命令
    Linux常用命令工具xshell工具链接:https://pan.baidu.com/s/1gLwhcbPQuRbOWK87sjTmBQ提取码:ep4nputty工具下载地址:https://www.putty.org/ xshell 常用快捷键#停止日志chrl+s#继续日志ctr......
  • xshell设置
    1、我们使用xhell时,在查看前面信息时突然有新的信息刷新又会滚到底部很烦。如下设置后就不会了: ......
  • shell脚本字体颜色和背景色
      !/bin/bash##下面是字体输出颜色及终端格式控制#字体色范围:30-37echo-e"\033[30m黑色字\033[0m"echo-e"\033[31m红色字\033[0m"echo-e"\033[32m绿色字\033[0m"echo-e"\033[33m黄色字\033[0m"echo-e"\033[34m蓝色字\0......
  • MYSQL SHELL 到底是个什么局 剑指 “大芒果”
    如果在WINDOWS上想链接在LINUX上的MYSQL有什么方法,windows上各种GUI,还是打开MYSQL那个原本黑漆漆的小方格。现在你有了新的选,MYSQLShell全新的连接MYSQL的方式,一个满足各种人群连接MYSQL的方式。从官方上下载后,在WINDOWS上解压后,直接点击执行。双击mysqlsh为什么要有mysqlshel......
  • Mysql 8 VS Mariadb 10.6 他们有多不一样 (声译)
    开头还是介绍一下群,如果感兴趣polardb,mongodb,mysql,postgresql ,redis等有问题,有需求都可以加群群内有各大数据库行业大咖,CTO,可以解决你的问题。首先要说明一点的,Mariadb不是MySQL,虽然他们有同一个历史的渊源,以及曾经类似的底层的代码,功能等等。但是MYSQL<> Mariadb......
  • shell 脚本构造大数据量的测试数据
    构造一个包含任意行,每行数据xx个字段,包含有递增ID、时间、整数、浮点、字符串的数据#!/bin/bash#要构造多少列的数据在data_line中配置data_line="1,2,3,4,5,6,7,8,9,10,11,12,col13filedatas,col14filedatas,col15filedatas,col16filedatas,col17filedatas,col18filedatas,col1......
  • MariaDB 中常见的 SQL 错误
    常见的SQL错误有以下几种:表名错误:如果数据库中没有该表,或代码中将表名写错,都会导致程序找不到该表。列名错误:如果某张表中不存在该字段,或代码中将字段名写错,都会导致程序找不到该字段。groupby错误:可能是select语句中的字段没有在groupby子句中出现。权限错误:在公司里面我们要对......
  • shell命令好文分享
    手册页部分1:用户命令 cshhttps://docs.oracle.com/cd/E56344_01/html/E54075/csh-1.html ......
  • Linux Powershell 安装教程
    在微软爱上 Linux 之后,PowerShell 这个原本只是Windows才能使用的组件,于2016年8月18日开源并且成为跨平台软件:https://linux.cn/article-7699-1.html,登陆了Linux和macOS。PowerShell 是一个微软开发的自动化任务和配置管理系统。它基于.NET框架,由命令......
  • shell sh脚本返回值大于255简单实验
    环境:ubuntu18.04代码:#!/bin/bashr=1000g=255##while循环得出的结果和$?显示的返回值一致,##说明大于255返回值,会一直减去255,直到获得一个小于255的值,才返回.whiletruedoecho"wl_r=$r"#letr=$r-$gr=$(($r-$g))if[$r-le255];then#-l......