SQL篇章--基于MySQL5.7--创建用户
Posted 缥缈之旅
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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 [email protected]:
CREATE USER ‘admin‘@‘localhost‘ IDENTIFIED WITH ‘mysql_native_password‘ AS ‘*67ACDEBDAB923990001F0FFB017EB8ED41861105‘ REQUIRE NONE PASSWORD EXPIRE DEFAULT ACCOUNT UNLOCK
DROP USER:
DROP USER ‘jeffrey‘@‘localhost‘;
以上是关于SQL篇章--基于MySQL5.7--创建用户的主要内容,如果未能解决你的问题,请参考以下文章
Centos7中 mysql5.7 用户 创建 授权远程登录