Welcome to the dBforums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

If you prefer not to see double-underlined words and corresponding ads, place your cursor
here for ContentLink opt out.

Go Back  dBforums > Database Server Software > MySQL > Mysql table could open

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-15-07, 11:26
bvo bvo is offline
Registered User
 
Join Date: May 2004
Posts: 29
Mysql table could open

hi,

I have a problem to open and/or describe table. The errors I had are


mysql_stgssl>desc ATL1_USER_DETAILS_VW;
ERROR 1356 (HY000): View 'atl1.ATL1_USER_DETAILS_VW' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
mysql_stgssl>select * from ATL1_USER_DETAILS_VW;
ERROR 1356 (HY000): View 'atl1.ATL1_USER_DETAILS_VW' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
mysql_stgssl>

thanks,

bvo
Reply With Quote
  #2 (permalink)  
Old 10-16-07, 06:13
aschk aschk is offline
Registered User
 
Join Date: Mar 2007
Location: 636f6d7075746572
Posts: 734
You have your error right there.
Seems fairly obvious.
1) You are trying to describe a view, which is perfectly valid but it's not the real table that you might be after, and will probably only offer information on the select query that generated it.
2) One/all of the underlying tables, table columns or functions that the view uses does not exist
3) The user you are currently trying to use to DESCRIBE the table does not have this privilege.
Reply With Quote
  #3 (permalink)  
Old 10-16-07, 14:17
bvo bvo is offline
Registered User
 
Join Date: May 2004
Posts: 29
I'm new with MySQl and do not know how to correct it... Would you please show me how? I am not create this table/view. Someone did and that person is somewhere I do not know.

Is there a way I can select the table name, user name to see who created it? I tried to select from dba_tables like Oracle and couldn't find the dba_tables or user_tables existed... Search on web for data dictionary chart for MySQL and again couldn't find it.

Thanks.

BV
Reply With Quote
  #4 (permalink)  
Old 10-17-07, 06:36
aschk aschk is offline
Registered User
 
Join Date: Mar 2007
Location: 636f6d7075746572
Posts: 734
At the cmd line you can execute "SHOW GRANTS" which will show you what permissions you have. (this may not work if you have insufficient permissions).
You can also do "SHOW TABLES" to show all the tables available to yourself.
To get information about the view you can use the information_schema table which is standard throughout SQL i believe. Again, if you don't have sufficient permissions you will be unable to use this database.
Code:
USE information_schema; SELECT * FROM VIEWS WHERE TABLE_NAME = 'ATL1_USER_DETAILS_VW'\G

The above should give you a VIEW_DEFINITION part which will specify the full query that is being executed. If you have missing tables there's nothing you can do about it unless you have a backup of previous data that may contain those tables, in which case you can restore them.
You will also see the DEFINER part which should specify which user created the view and thus which user can also use it. If you don't have VIEW permissions you won't be able to use the view as the current user you are.

Last edited by aschk : 10-17-07 at 06:40.
Reply With Quote
  #5 (permalink)  
Old 10-22-07, 13:16
bvo bvo is offline
Registered User
 
Join Date: May 2004
Posts: 29
Thanks very much for your help
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On