In mysql, the show databases; command doesn't list all of my databases

故事扮演 提交于 2021-02-06 15:17:19

问题


I can access all of my databases with HeidiSQL, but if I go to the mysql.exe window and use show databases; only 2 of them show up out of 11. These are all databases on 127.0.0.1. Any ideas on why?


回答1:


You're logging into HeidiSQL as root, so it's showing you all databases, but you're logging into mysql.exe as the current Windows user (since that's the default), so it's only showing you the databases that that user can see. If you run mysql.exe with --user=root --password=..., it will show you all databases.




回答2:


in my case, SHOW DATABASES or SHOW DATABASES; didn't work.

what worked is:

show databases;



回答3:


I am using Oracle mySql

mysql> show databases;

This command show all databases in your SQL server




回答4:


First, you have to log in using your username and password before you issue show databases command on cmd. If you request show databases without this, cmd will only show you default databases. your username and password(optional if you username is root) grant you the needed access to the databases. This is my experience and I hope it helps.




回答5:


If you are in a screen session, that can also truncate your results. Just thought I'd throw that out there since that's what my issue was that led me here ---



来源:https://stackoverflow.com/questions/9558029/in-mysql-the-show-databases-command-doesnt-list-all-of-my-databases

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!