新增用户并回收root用户的权限
flush privileges;
grant all privileges on *.* to 'root'@'%' identified by 'Test2024' with grant option;
grant all privileges on *.* to 'magic'@'%' identified by 'Test2024' with grant option;
flush privileges;
select user,host from mysql.user;
revoke all on *.* from 'root'@'%';
show grants for 'root'@'%';
show grants for 'magic'@'%';
修改视图的DEFINER:
SELECT
concat(
"alter DEFINER = 'magic'@'%' SQL SECURITY DEFINER VIEW ",
TABLE_SCHEMA,
".",
TABLE_NAME,
" as ",
VIEW_DEFINITION,
";"
)
FROM
information_schema.VIEWS
WHERE
DEFINER = 'skip-grants user@skip-grants host';
注释掉mysql的配置:vim /etc/my.cnf
[mysqld]
#skip-grant-tables
修改程序的配置:vi /etc/LSMainFrameDB.INI