tags:

views:

24

answers:

4

I have a sql query done by someone. I cannot seem to see the table where query is reading from, but offline, the table is in the same db. The dbconfig is the same offline and online.

Is there any way I can find where the table is, or unhide if hidden.

Thanks Jean

+1  A: 

This sounds like a permissions issue. If you're the database administrator, login as root to see all the tables that exist. (If you can't see it as root, it just plain doesn't exist.)

If you're not the database administrator, contact whoever is to get access.

VoteyDisciple
@votyedisciple it does exists, because I inserted, selected and deleted data into the table. I checked if there were any views or temporary tables, but none.
Jean
Then like I said, you not being able to see it is a permissions issue.
VoteyDisciple
I connected using ssh. went to mysql -u -p and show databases. then use database, show tables. describe particular_table. used root for the same
Jean
Well, if it doesn't show up when logged in as `root` you can be 100% certain that the table does not exist. Posting the particular query and some details about the database may help to figure out what's going on.
VoteyDisciple
A: 

Please post the query. Some points to consider -

  1. Maybe you are not in the correct database. Change to that database & try again.
  2. Maybe you don't have permissions to log into that DB. Your script has (thanks to correct username, password).

That's all I can think of for now. Post your query so answer can be more constructive...

MovieYoda
I connected using ssh. went to mysql -u -p and show databases. then use database, show tables. describe particular_table. used root for the same
Jean
try this mysql -uroot -p <your_db_name>. see if you see your table now.
MovieYoda
+1  A: 

you can try running the query "show full processlist;" which will show you what connections exist, what database they are connected to, and what query they are currently executing.

You can also turn on query logging by adding "log = /path/to/logfile" to the config file or "-l logfile" to the mysqld command line and watch the queries executed there, though note that this can be a performance killer.

stew
A: 

Thanks issue solved.

[edit] Sorry guys...

@pekka ofcourse, had to jot quickly to close the issue.

I was auditing couple of servers, and noticed that one particular table in a db was missing, but queries was fine. It was on one server, which had nothing to do with the db. I had root access, but could not see anything, but a test db.

Thanks all for your help, as you all have been. Every answer is equal to a correct answer, and I am unable to mark it correct. Therefore I have given an upvote for all.

Thanks again

Jean
Please be so fair and tell people here what the reason was. (You can edit your question and remove this answer)
Pekka