【SQL篇章--基于MySQL5.7--创建用户】
SQL:
创建用户:>=MySQL5.7.6
查看用户:
mysql> select user,host,authentication_string from mysql.user;
ALTER USER:
ALTER USER [IF EXISTS]USER() IDENTIFIED BY 'auth_string';
ADDING USER ACCOUNT:
CREATE USER 'finley'@'localhost' IDENTIFIED BY 'some_pass'; GRANT ALL PRIVILEGES ON *.* TO 'finley'@'localhost' WITH GRANT OPTION;
CREATE USER 'finley'@'%' IDENTIFIED BY 'some_pass'; GRANT ALL PRIVILEGES ON *.* TO 'finley'@'%' WITH GRANT OPTION;
mysql> CREATE USER 'admin'@'localhost' IDENTIFIED BY 'admin_pass';
mysql> GRANT RELOAD,PROCESS ON *.* TO 'admin'@'localhost';
mysql> CREATE USER 'dummy'@'localhost';
mysql> SHOW CREATE USER 'admin'@'localhost'\G
*************************** 1. row ***************************
CREATE USER for admin@localhost:
CREATE USER 'admin'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*67ACDEBDAB923990001F0FFB017EB8ED41861105' REQUIRE NONE PASSWORD EXPIRE DEFAULT ACCOUNT UNLOCK
DROP USER:
DROP USER 'jeffrey'@'localhost';
远方不一定有诗,但有更好的自己!你我共勉!
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步