MYSQL restrict user access to information_schema

后端 未结 2 1431
慢半拍i
慢半拍i 2021-02-19 03:20

I have a MySQL server (Server version: 5.1.68-community; MySQL client version: 5.0.51a). Is there any way to restrict ALL access to information_schema for all users?

Wh

2条回答
  •  攒了一身酷
    2021-02-19 03:50

    One cannot prevent access to the information_schema (yet), but in the case of sql-injections through GET Request, it is easy to do a:

    RewriteCond %{REQUEST_FILENAME}   !handle_error\.php
    RewriteCond %{QUERY_STRING}   information_schema
    RewriteRule  ^(.*?)          /handle_error.php [R=301,L]
    

    in your .htaccess and this should save one some headache.

提交回复
热议问题