mysql> 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
mysql的命令以分号结尾,回车不算结尾,所以你实际执行的命令是show databasesshow databases;
解决方法,直接输show databases;(注意有分号)即可