1、用root用户登录数据库
sudo mysql
2、创建用户
create user test@localhost;
3、给用户授权
grant all privileges on dbgo.* to test@localhost identified by '123';
dbgo是事先建好的数据库
4、用新建的用户登录数据库
sudo mysql -u test -p dbgo
输入密码
1、用root用户登录数据库
sudo mysql
2、创建用户
create user test@localhost;
3、给用户授权
grant all privileges on dbgo.* to test@localhost identified by '123';
dbgo是事先建好的数据库
4、用新建的用户登录数据库
sudo mysql -u test -p dbgo
输入密码