General error error: 1449 when searching MySQL Bank records

1

I'm getting the error below when doing SELECT:

SELECT * FROM vn_horario_view;
  

SQLSTATE [HY000]: General error: 1449 The user specified as a definer ('root' @ 'localhost') does not exist

How do I resolve this error?

    
asked by anonymous 22.02.2017 / 20:00

1 answer

2

If you imported the objects from another database you may have lost some DEFINER .

Try:

SELECT CONCAT("ALTER DEFINER='youruser'@'host' VIEW ", 
table_name, " AS ", view_definition, ";") 
FROM information_schema.views 
WHERE table_schema='your-database-name';

You can also create a new user giving him full access, if everything runs correctly you delete root and rename the new user to root (Gambiarra)!

Same problem in SOen

    
22.02.2017 / 21:59