1,创建新用户
以管理员root账号登录,通过执行创建用户脚本
格式:create user "username"@"host" identified by "password";
username 为创建的用户名称
host 为相关的访问地址
password 为相关的密码
例如:
create user 'test'@'localhost' identified by '123';
2,授权
以管理员账号登录,通过执行如下脚本授权
格式:grant privileges on databasename.tablename to 'username'@'host'
databasename 为数据库名称
tablename 为数据库内的表名称,当为 * 时