Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What does MySQL Shell mean?

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article shows you what MySQL Shell means. It is concise and easy to understand. It will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.

MySQL Shell is launched in the official version 5.7.12, the original intention of the tool itself is to solve a kind of problem, presumably the official know the use of the tool from many aspects, support too many development languages, it is difficult to tune, so such a command line tool came out, from its launch, enough to see the pattern of MySQL, it is to do a lot of what can not be done to take over to do their own. According to the official shell,python, native SQL,Javascript, etc., the format is all JSON.

If you still have some doubts about this tool, the latest version of InnoDB Cluster can be used as one of the standard components, if you want to build this environment, the standard steps are in accordance with the operation of MySQL Shell, plus MySQL Router,MGR, this set is complete.

The tool itself is an optional component, and it's a good choice if it's usually used. The latest version is 1.0.9 and the binary version can be downloaded in the following ways.

The wget https://dev.mysql.com/get/Downloads/MySQL-Shell/mysql-shell-1.0.9-linux-glibc2.12-x86-64bit.tar.gz-- the no-check-certificate mysqlsh command is the core of the tool, and if you look at the mysqlsh command, it looks like this:

# file mysqlsh

Mysqlsh: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped

Suppose you connect to MySQL in the following way.

# mysql-uroot-h227.0.0.1-- port=3308-pmysql

Then it's easy in mysqlsh.

Mysql-js >\ connect root:mysql@127.0.0.1:3308

Creating a Session to 'root@127.0.0.1:3308'

Classic Session successfully established. No default schema selected.

If you look at the status of the MySQL service, it is a very simple status

Mysql-js >\ status

MySQL Shell Version 1.0.9

Session type: Classic

Connection Id: 1571

Default schema:

Current schema:

Current user: root@localhost

SSL: Cipher in use: null

Server version: MySQL Community Server (GPL)

Server info: 5.7.17-log

Protocol version: 10

Connection: 127.0.0.1 via TCP/IP

Server characterset: latin1

Schema characterset: latin1

Client characterset: latin1

Conn. Characterset: latin1

Up time: 47 days, 22 hours, 40 minutes, 57 sec

Threads: 3 Questions: 691328 Slow queries: 0 Opens: 10336 Flush tables: 35 Open tables: 69 Queries per second avg: 0.166

Mysql-js >

Generally speaking, the usage is very similar to MongoDB, and the style is also similar to PG.

For example, switch to sql mode.

Mysql-js >\ sql

Switching to SQL mode... Commands end with

Mysql-sql > select @ @ port

+-+

| | @ @ port |

+-+

| | 3308 |

+-+

The connection of MySQL Shell also supports uri, which is in the form of mysqlsh-uri.

Of course, a lot of information can be called through API.

Such as checking status and so on.

Mysql-js > dba.configureLocalInstance ('root@127.0.0.1:3308')

Please provide the password for 'root@127.0.0.1:3308':

Please fix these issues and try again.

{

"errors": []

"restart_required": false

"status": "error"

}

What does MySQL Shell mean? have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report