Mysql grant restricted to specific hours of a day



  • I'd like to know if it is possible in mysql to grant select permission to user but only within specific hours of a day.

    I have created several views and new user and want to let them browse those mysql views only (for example) between 10pm and 11pm.



  • Edit the view criteria to be:

    WHERE ... (previous criteria)
    AND (CURRENT_USER() != 'bob@%' OR CURTIME() BETWEEN '22:00' AND '23:00')
    

    This restricts the bob user on these times, otherwise no results are returned in the view.




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2