I got an error when trying to execute "mysql -u root -p" ER_PARSE_ERROR on PopSQL

32 views Asked by At

I'm still learning SQL and I get an error when trying to execute "MySQL 8.0 Command Line" using mysql -u root -p on PopSQL. I got the following error:

Error: You have an error in your SQL syntax; check the manual that 
corresponds to your MySQL server version for the right syntax to use 
near 'mysql -u root -p' at line 1.
Error Code: ER_PARSE_ERROR

I don't know why is this happening.

I tried closing and restarting PopSQL and the PC but non of them worked...

1

There are 1 answers

3
lavantho0508 On

This is when you are connected to the database and have a session, it will only accept queries or support options like \h ...

mysql - u root -p

is used to connect to MySQL server on Terminal or CommandLine , Once you are connected you have to use SQL commands like Create table , ....