MySQL Shell Command

Install MySql Shell in Linux

[ec2-user@ip-172-31-21-2 ~]$ sudo yum install mysql-shell

 

Some example of MySQL Shell Command

[ec2-user@ip-172-31-21-2 ~]$ sudo mysqlsh

MySQL Shell 8.0.34

 

Copyright (c) 2016, 2023, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its affiliates.

Other names may be trademarks of their respective owners.

 

Type '\help' or '\?' for help; '\quit' to exit.

 MySQL  JS > \connect root@localhost:3306

Creating a session to 'root@localhost:3306'

Please provide the password for 'root@localhost:3306': ******

Save password for 'root@localhost:3306'? [Y]es/[N]o/Ne[v]er (default No): y

 

Switch to SQL command mode with the command \sql :

MySQL  localhost:3306 ssl  JS > \sql

Switching to SQL mode... Commands end with ;

Fetching global names for auto-completion... Press ^C to stop.

 MySQL  localhost:3306 ssl  SQL > show databases;

MySQL  localhost:3306 ssl  SQL > use information_schema

MySQL  localhost:3306 ssl  information_schema  SQL > show tables;

 

MySQL  localhost:3306 ssl  information_schema  SQL > select * from CHARACTER_SETS;

 

MySQL  localhost:3306 ssl  information_schema  SQL > \quit

MySQL  JS > \system ls

MySQL  JS > \system cd /var/log/