ERROR 1142 (42000): INSERT command denied to user 'radius'@'localhost' for table 'radcheck'

时间:2022-12-09 19:19:08

/etc/freeradius# mysql -uradius -p

passwd:


mysql> use radius;

mysql> show tables;
+------------------+
| Tables_in_radius |
+------------------+
| radacct                |
| radcheck             |
| radgroupcheck    |
| radgroupreply      |
| radpostauth         |
| radreply               |
| radusergroup       |
+------------------+

7 rows in set (0.00 sec)


mysql> insert into radgroupreply (groupname,attribute,op,value) values ('user','Auth-Type',':=','Local');
ERROR 1142 (42000): INSERT command denied to user 'radius'@'localhost' for table 'radgroupreply'


原因:权限不够,登录数据库的方式不对。用mysql -uradius -p 方式登录进去后无法进行插入操作,需要用root用户登录。

解决:/etc/freeradius# mysql -uroot -p

passwd:

mysql> use radius;

mysql> insert into radgroupreply (groupname,attribute,op,value) values ('user','Auth-Type',':=','Local');

Query OK, 1 row affected (0.00 sec)

成功!