alter user 'root'@'localhost' identified by '123'; flush privileges; quit;
查看所有用户
1 2
usemysql; select distinct(User) from user;
通过远程访问
1 2 3 4 5 6
//查看用户权限情况 select host,user from user; //root是用户名,%代表任意主机,'123456'指定的登录密码(这个和本地的root密码可以设置不同的,互不影响) grant all privileges on *.* to 'root'@'%' identified by'123456'with grant option; flush privileges; quit;