mysql forgets who is logged in: command denied to user ''@'%'

后端 未结 3 1881
悲哀的现实
悲哀的现实 2020-12-09 11:00

Running show grants; indicates that I am logged in as a user with all privileges on a database.

Running show table status; results in an er

3条回答
  •  青春惊慌失措
    2020-12-09 11:43

    The answers here helped me with my specific problem. Many thanks! A view was the culprit as described above.

    I got into trouble because the database in question was created from a backup of a remote database which had different users. The 'broken' view was 'defined' by a user I didn't have locally. Even root was unable to run the crashing query.

    Changed the view's 'DEFINER' to a valid local user and the problem was solved!

    ALTER 
    DEFINER = 'a_valid_user'@'localhost' 
    VIEW my_view
    AS 
    SELECT ..... 
    

    Check out ALTER VIEW documentation for MySQL 5.5

    Many thanks again!

提交回复
热议问题