LinuxCommandLibrary

mysqlsh

mySQL Shell client

TLDR

Start MySQL Shell

$ mysqlsh
copy
Connect to server
$ mysqlsh -u [username] -h [hostname]
copy
Connect with URI
$ mysqlsh [mysql://user@host:3306/database]
copy
Execute SQL mode
$ mysqlsh --sql -u [user] -e "[SELECT 1]"
copy
JavaScript mode
$ mysqlsh --js
copy
Python mode
$ mysqlsh --py
copy
Run script
$ mysqlsh -f [script.js]
copy

SYNOPSIS

mysqlsh [options] [uri]

DESCRIPTION

mysqlsh is the MySQL Shell client. It provides SQL, JavaScript, and Python interfaces.
The tool supports MySQL 8.0 features. Includes AdminAPI for cluster management.

PARAMETERS

URI

Connection URI.
-u USER
Username.
-h HOST
Hostname.
--sql
SQL mode.
--js
JavaScript mode.
--py
Python mode.
-f FILE
Execute script file.
--help
Display help information.

CAVEATS

Requires MySQL 8.0+. Three language modes. Replaces legacy mysql for new features.

HISTORY

MySQL Shell was introduced with MySQL 8.0 as a modern client supporting multiple scripting languages.

SEE ALSO

mysql(1), mysqladmin(1), mycli(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community