Posted on:
Last modified:
创建用户
CREATE USER "newuser"@"%" IDENTIFIED BY "password";
授权所有权限
GRANT ALL PRIVILEGES ON *.* TO "newuser"@"%";
FLUSH PRIVILEGES;
其中的 %
代表这个用户可以在任意主机登录。
如果只需要在本机登录,使用 localhost
显示一个用户的当前授权:
SHOW GRANTS FOR newuser
更改用户密码:
ALTER USER 'root'@'localhost' IDENTIFIED BY 'yourpasswd';
flush privileges;
EXPLAIN, slow-log
© 2016-2022 Yifei Kong. Powered by ynotes
All contents are under the CC-BY-NC-SA license, if not otherwise specified.
Opinions expressed here are solely my own and do not express the views or opinions of my employer.
友情链接: MySQL 教程站