英文:
Can't see MySQL database from terminal that I created on Workbench using "SHOW DATABASES"
问题
我最近在我的MacOs上下载了MySQL社区版和MySQL Workbench。我在Workbench上创建了数据库,可以进行更新和操作。
但是,当我尝试在终端中运行例如SHOW DATABASES
时,我无法看到我使用Workbench创建的数据库。
所有命令在MySQL Workbench中都能正常运行。
但与此同时,我无法看到我使用Workbench创建的任何数据库。
这不是我的截图,但我希望能够获得类似的输出。
英文:
I have recently downloaded MySQL community and MySQL workbench on my MacOs.
I created database on workbench and I am able to do updates and work there.
But when I try to do for ex: "SHOW DATABASES
from terminal I am not able to see the databases I have created using workbench
All the commands are working and are fine here in MySQL workbench
But at the same time, I am unable to see any of my databases that i created using workbench
This is not mine, but I expect to get similar output.
答案1
得分: 2
使用 show databases;
而不是 show databases
。MySQL 使用 ;
来表示语句的结束,因此在语句之后需要添加 ;
。在终端中使用时,你遗漏了 ;
。
英文:
Use show databases;
rather than show databases
. MySQL uses ;
to indicate the end of a statement, so you need to add ;
after a statement. You lost the ;
while using terminal.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论