多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
### 创建数据库: mysql> create database max_finance_dev; mysql> create database max_finance_test; 授权用户: mysql> CREATE USER 'finance'@'%' IDENTIFIED BY 'e@finance'; mysql> grant all on max_finance_dev.* TO 'finance'@'%'; mysql> grant all on max_finance_test.* TO 'finance'@'%'; ### 查看用户权限: mysql> show grants for 'finance'@'%'; +----------------------------------------------------------------------+ | Grants for finance@% | +----------------------------------------------------------------------+ | GRANT USAGE ON *.* TO 'finance'@'%' | | GRANT ALL PRIVILEGES ON `max_finance_test`.* TO 'finance'@'%' | | GRANT ALL PRIVILEGES ON `finance_dev`.* TO 'finance'@'%' | +----------------------------------------------------------------------+ 4 rows in set (0.00 sec) ### 权限回收 mysql> revoke all PRIVILEGES ON `finance`.* from 'finance'@'%' mysql> show grants for 'finance'@'%'; +----------------------------------------------------------------------+ | Grants for finance@% | +----------------------------------------------------------------------+ | GRANT USAGE ON *.* TO 'finance'@'%' | | GRANT ALL PRIVILEGES ON `max_finance_test`.* TO 'finance'@'%' | | GRANT ALL PRIVILEGES ON `max_finance_dev`.* TO 'finance'@'%' | +----------------------------------------------------------------------+ 3 rows in set (0.00 sec)