- 打开MySQL shell工具
- 使用连接命令 \connect \c --mysql [username]@[host:port] port缺省为3306
NAME
\connect - Connects the shell to a MySQL server and assigns the global
session.
SYNTAX
\connect [<TYPE>] <URI>
\c [<TYPE>] <URI>
DESCRIPTION
TYPE is an optional parameter to specify the session type. Accepts the
following values:
- --mc, --mysql: create a classic MySQL protocol session (default port
3306)
- --mx, --mysqlx: create an X protocol session (default port 33060)
If TYPE is omitted, automatic protocol detection is done, unless the
protocol is given in the URI.
URI format is: [user[:password]@]hostname[:port]
EXAMPLE
\connect --mx root@localhost
Creates a global session using the X protocol to the indicated URI.
- 按提示输入密码
- 进入sql控制台页面
备注: 使用 \js,\sql命令可在sql及js模式进行切换