Harsh Srivastava
Harsh Srivastava

Reputation: 105

How to change the MySQL JS> prompt to only MySQL>?

I did a custom installation for MySQL and only included the MySQL shell, the server, and the Python connector in the installation.

But I don't know where the JavaScript prompt MySQL JS > came from.

And because of that I can't connect Python and MySQL.

Screenshot of MySQL JS prompt

Upvotes: 10

Views: 18767

Answers (4)

PeterJames
PeterJames

Reputation: 1353

If you are faced with the JS> prompt after running the MySQL shell, like so:

screenshot showing JS prompt in MySQL shell

where JS means JavaScript, then you can change modes by issuing one of the following shell commands:

\sql
\py
\js

For SQL mode, Python mode, and JavaScript mode, respectively. Like so:

screenshot showing how to set all prompts in MySQL shell

If you want to change the prompt permanently, then you need to set the defaultMode option, like so:

\option --persist defaultMode=sql 

at the JS>, PY>, or SQL> prompt.

You can also list the option settings with:

\options -l

The Configuring MySQL Shell Options page in the MySQL documentation explains this all in great detail.

Upvotes: 0

Seyed Muzaffar
Seyed Muzaffar

Reputation: 11

If there is someone who got this error and was expecting "Mysql>" rather than "MySQL js>" or even "MYSQL SQL>", you have opened a wrong program. You need to open MySQL x.x command line client program rather than mysql shell program.

Upvotes: 0

Haider Mansoor
Haider Mansoor

Reputation: 324

Just switch the execution mode to sql in the shell:

\sql

Upvotes: 12

Priyanshu Sharma
Priyanshu Sharma

Reputation: 1

[1. write " \sql " (this will convert SQL-JS to sql ] 2. write as shown in the image

\sql \connect root localhost

Upvotes: -1

Related Questions