当前位置:网站首页>MySQL项目8总结
MySQL项目8总结
2022-06-26 09:37:00 【m0_61961898】
添加数据库用户
CREATE USER ‘username’@‘host’ IDENTIFIED BY ‘password’;
username – 你将创建的用户名说明:
host – 指定该用户在哪个主机上可以登陆,如果是本地用户可用localhost, 如 果想让该用户可以从任意远程主机登陆,可以使用通配符%
password – 该用户的登陆密码,密码可以为空,如果为空则该用户可以不需要密码登 陆服务器
给予、回收数据库用户权限
授权
GRANT privileges ON databasename.tablename TO ‘username’@‘host’;
privileges – 用户的操作权限,如SELECT , INSERT , UPDATE 等(详细列表见该文最后面).如果要授予所 的权限则使用ALL说明:
databasename – 数据库名
tablename-表名,如果要授予该用户对所有数据库和表的相应操作权限则可用* 表示, 如*.*
用以上命令授权的用户不能给其它用户授权,如果想让该用户可以授权,用以下命令
GRANT privileges ON databasename.tablename TO ‘username’@‘host’ WITH
GRANT OPTION;
设置与更改用户密码
SET PASSWORD FOR ‘username’@‘host’ = PASSWORD(‘newpassword’);
如果是当前登陆用户用
SET PASSWORD = PASSWORD(“newpassword”);
边栏推荐
- exec系列函数(execl、execlp、execle、execv、execvp)使用
- 2. merge two ordered arrays
- From TF 1 X to TF 2.6 (update if you encounter it)
- The basis of C language grammar -- function definition learning
- 微软 Edge 浏览器 IE 模式标签页出现卡死情况,已通过回滚更新修复
- String类intern()方法和字符串常量池
- US President signs community safety act to deal with gun issue
- DAY 3 数组,前置后置,字符空间,关键词和地址指针
- SQL advanced tutorial
- 1. sum of two numbers (leetcode topic)
猜你喜欢

定制拦截器

118. Yanghui triangle

2021 national vocational college skills competition (secondary vocational group) network security competition questions (1) detailed analysis tutorial

创建对象的时候堆内存的分配

Redis notes (13) - scan and keys search for specific prefix key fields (command format, usage examples, locating large keys)

测试须知——常见接口协议解析

【Leetcode】76. 最小覆盖子串

druid数据源实现后台监控

Basic string operations in C

Extracting public fragments from thymeleaf
随机推荐
logback
JVM的符号引用和直接引用是什么
libmagic 介绍
創建對象的時候堆內存的分配
String类intern()方法和字符串常量池
Daily-used English phrases
thymeleaf中抽取公共片段
MySQL learning summary
SQL function
A concise tutorial for getting started with go generics
Jupyter Notebook遇到的问题
The basis of C language grammar -- function nesting, Fibonacci sum of recursive applet and factorial
Vscode common programming fonts
Configuration internationale
The IE mode tab of Microsoft edge browser is stuck, which has been fixed by rolling back the update
Meaning of go runtime
2021 national vocational college skills competition (secondary vocational group) network security competition questions (1) detailed analysis tutorial
Does the go compiled executable have dynamic library links?
echo $?
Redis notes (16) - info instructions and command line tools (view memory, status, number of client connections, monitoring server, scan large keys, sampling server, execute batch commands, etc.)