I just installed MySQL on my computer and when I try to create a database from the MySQL shell, I get this error:
MySQL JS > CREATE DATABASE databasename; SyntaxError: Unexpected identifier
Does anyone know why this is happening? Is there a problem with the installation of MySQL?
To solve the "Uncaught SyntaxError: Unexpected identifier" error, make sure you don't have any misspelled keywords, e.g. Let or Function instead of let and function , and correct any typos related to a missing or an extra comma, colon, parenthesis, quote or bracket.
The active mode determines how the executed statements are processed: If using SQL mode, statements are processed as SQL which means they are sent to the MySQL server for execution. If using JavaScript mode, statements are processed as JavaScript code.
MySQL Shell is an advanced command-line client and code editor for MySQL. In addition to SQL, MySQL Shell also offers scripting capabilities for JavaScript and Python. For information about using MySQL Shell, see MySQL Shell 8.0.
By looking at this thread here, it looks like you might be using the shell in js mode, you might be able to toggle it off by using the switch
\sql
https://forums.mysql.com/read.php?10,661192,661203#msg-661203
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With