CREATE USER 'column_user'@'%' IDENTIFIED BY 'Test@123456';
AI 乱删数据
AI 插入错误位置数据
AI 删库,删表,删字段
AI 乱更新数据位置
等等对AI可能的误操作进行各种的防护。
1 只允许查看表中的三个字段,不许可看员工的工资,电话,和邮箱。
GRANT SELECT(id,name,department) ON employee TO 'column_user'@'%';
以上操作完毕后,
查看结果问题
2 插入数据限制
mysql> GRANT INSERT(name,department,phone) ON employee TO 'column_user'@'%'; Query OK, 0 rows affected (0.01 sec)
数据库插入数据失败
3 针对更新数据
mysql> mysql> GRANT UPDATE(phone,email) ON security_test.employee TO 'column_user'@'%'; ERROR 1049 (42000): Unknown database 'security_test' mysql> mysql> GRANT UPDATE(phone,email) ON employee TO 'column_user'@'%'; Query OK, 0 rows affected (0.00 sec)