MySQL is one of the most recommended tools for managing and organizing data in a database. In this article, I outline steps to help fix the error
Syntax Error: Unexpected Identifier when connecting to the MySQL shell server
Why the error?
This error mostly occurs when using the MySQL shell in
JS mode, preventing users from directly running queries after launching the MySQL shell.
Fixing the Syntax Error
To fix the error, you have to switch the shell to
SQL mode and connect to the server.
Switch the MySQL shell from
SQL mode using the command below;
Connect to the server using the MySQL user and hostname specified during the installation process. Use the command below
rootrepresent the user, while
localhostrepresents the hostname
See the screenshot below
Congrats, you have resolved the error and can proceed to create a database.
Lastly, if you want to create a database, the command to use is as below
create database databaseName;
In this article, we learned how to fix the
Unexpected Identifier error when using
Latest comments (2)
Glab to be of help