MySQL新增用户并赋予权限

  1. 创建用户:create user "username"@"host" identified by "password";

  2. 修改用户密码:

    1. 用set password命令:SET PASSWORD FOR 'root'@'localhost' = PASSWORD('123456');

    2. 用mysqladmin:mysqladmin -uroot -p123456 password 1234abcd

  3. 赋予权限:grant all privileges on `test`.* to 'test'@'%' ;

上一篇: 没有了