安装

优质
小牛编辑
123浏览
2023-12-01

成功最有效的方法是像有经验的人学习,我准备从现在开始这样去做.

这一章节是记录在学习过程中遇到的一些关于MySQL安装过程中的笔记


安装完数据库记得清除默认的无用数据,减少潜在危险

drop database test; #删除默认数据库
delete from mysql.user where user=''; #删除不需要的用户

用户授权(with grant option 参数意为被授权的用户拥有给其他用户授权的权力)

grant all prilieges on *.* to test@'192.168.1.%' identified by 'aaaaaa' with grant option;

授权所有库所有表的所有权限给test用户
该用户只能通过ip为192.168.1.(1~254)登录,密码为aaaaaa
且该用户有管理用户的权限

新增一个项目授权方案(比如OneThink)

grant creat,select,insert,update,delete on onethink.* to 'onethink'@localhost identified by 'yourPassword';

安装完后,回收 create 权限,保留 insert,delete,updaet,select 权限。

revoke create on onethink.* from 'onethink'@localhost;