1

I am new to using MySQL on a Mac. I am trying to show all the default databases but nothing is showing up when I use the command "show databases".

I have tried uppercase and lowercase. As well as using a semicolon and without it.

-> show databases ->

SHOW DATABASES; ERROR 1064 (42000): 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 'SHOW DATABASES' at line 2

I am trying to see the default databases in MySQL before proceeding

2
  • Did you login with a valid account that is allowed to do this Commented Sep 4, 2019 at 18:30
  • Try again with the semi-colon. From what it looks like here, your command is show databases SHOW DATABASES; so of course that's not going to work. There are very few commands that will work without a semi-colon; without it, it thinks you're going to continue the command on the next line. Commented Sep 4, 2019 at 18:30

3 Answers 3

2

I was logged in as root user but getting same error, finally trying some combination found that in "Show DATABASES;" command DATABASES part is case sensitive.

Sign up to request clarification or add additional context in comments.

1 Comment

For me (MySQL 8.0) the right syntax is show DATABASES;. Setting all caracters in uppercases or lowcases won't work.
0

You have to add ';' before ending the line. -> show databases;

Best of Luck.

3 Comments

If there is any typo in the given code, please vote to close the question instead of answering it
This does not provide an answer to the question. Once you have sufficient reputation you will be able to comment on any post; instead, provide answers that don't require clarification from the asker. - From Review
Providing a syntax fix looks like an answer to me. Helped in my case 😅
-1

Here you can type SHOW DATABASES; SHOW & DATABASES both are case sensitive and do not forgot ; in last

1 Comment

If there is any typo in the given code, please vote to close the question instead of answering it. Also, are you sure that these queries are case sensitive?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.