473,398 Members | 2,188 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

question about show databases;

Hi everyone. I just installed MySQL on my home PC and I tested out the
show databases query, and it lists two:

information_schema
bbdatabank

The second one is one I created myself, but I don't understand what the
first one is. It is not listed in my 'data' folder, but mysql and test
*are*, yet they aren't listed when I type the show command. Why is that?
How can I get them listed so that I can use them, and what is the
information_schema?

Thanks!
John
May 21 '06 #1
3 1953
>Hi everyone. I just installed MySQL on my home PC and I tested out the
show databases query, and it lists two:

information_schema
bbdatabank

The second one is one I created myself, but I don't understand what the
first one is. It is not listed in my 'data' folder, but mysql and test
*are*, yet they aren't listed when I type the show command. Why is that?
Unless you have the "show databases" privilege, you can only see
databases you have some privileges on.
How can I get them listed so that I can use them, and what is the
information_schema?


Use a username and a password with privileges to use them (e.g. the
root account set up when you installed MySQL).

information_schema is a database giving information on the databases
and stuff in them. Another way of getting a list of databases is
"select schema_name from information_schema.schemata". It is
automatically generated from the databases, so if you create or
delete tables or columns in them, it's automatically up to date.
On the other hand, it tends to be a bit slow if you list a whole
table.

Some of the information in information_schema is sensitive to privileges.
You may not see the rows for things you don't have access to.

Gordon L. Burditt
May 22 '06 #2
Gordon Burditt wrote:

Use a username and a password with privileges to use them (e.g. the
root account set up when you installed MySQL).

information_schema is a database giving information on the databases
and stuff in them. Another way of getting a list of databases is
"select schema_name from information_schema.schemata". It is
automatically generated from the databases, so if you create or
delete tables or columns in them, it's automatically up to date.
On the other hand, it tends to be a bit slow if you list a whole
table.


Thank you! I realized that I wasn't seeing mysql or test because I
wasn't signed in as the root account. As for the other question, thanks
for explaining. I'll just leave it alone! :)
May 22 '06 #3
>> information_schema is a database giving information on the databases
and stuff in them. Another way of getting a list of databases is
"select schema_name from information_schema.schemata". It is
automatically generated from the databases, so if you create or
delete tables or columns in them, it's automatically up to date.
On the other hand, it tends to be a bit slow if you list a whole
table.


Thank you! I realized that I wasn't seeing mysql or test because I
wasn't signed in as the root account. As for the other question, thanks
for explaining. I'll just leave it alone! :)


information_schema does have its uses. For example, it's easy to
list all the tables with a 'stamp' column in them. And information_schema
is a bit less MySQL-specific than various "SHOW" commands, and you
can put a WHERE clause on the queries.

It *is* a really good idea to leave information_schema alone when
using mysqldump or restoring the output of mysqldump.

Gordon L. Burditt
May 22 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Tom Jones | last post by:
I need to use php's native mssql api in order to read the meta data from an entire DBMS ... I have sql server 2000 up and running and using the provided browsing tools poked around and found that...
2
by: j-marvin | last post by:
hi- i just went to ipowerweb.com to set up my db. it has an easy web interface. what is confusing me is i bought a mysql book and i thought there was all this administration i had to worry...
2
by: Tim Williams | last post by:
I'm trying to write a simple python program to access a MySQL database. I'm having a problem with using MySQLdb to get the results of a SQL command in a cursor. Sometimes the cursor.execute works,...
2
by: mark | r | last post by:
I have shared hosting that can support SQL databases. i currently use access. whats the process in... a. converting access to sql b. uploading the database file is it the same as access, where...
0
by: Vladimir Trebicky | last post by:
Hi, I've been trying to solve this problem for a long time. Only thing I did when upgrading from 3.25 to 4.0.14 I took the default my.cnf. I did not convert the privilege tables with...
7
by: chessplayer | last post by:
Greetings Folks, I am trying to understand how DB2 locks data and can't believe my eyes. Have read the literature about the difference isolation levels and have a general understanding about...
3
by: windandwaves | last post by:
Hi Gurus Does anyone know how I set the error trapping to option 2 in visual basic. I know that you can go to tools, options and then choose on unhandled errors only, but is there a VB command...
2
by: Calvin | last post by:
I'm fairly new to programming, that said, I know how to 'program', but my question is about design. How big and what sort of objects should be stored in Session. I'm doing an e-commerce...
1
by: judy | last post by:
I have several databases that are used to collect data for different client-projects. My intention was to collect the data, and administer mySQL so each client could see only their data. Each of...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.