当前位置:网站首页>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”);
边栏推荐
- Automated testing -- Introduction and example of pytest framework
- 【Leetcode】76. Minimum covering substring
- What should the preview do?
- A concise tutorial for getting started with go generics
- Win10安装tensorflow-quantum过程详解
- WIN10系统实现Redis主从复制
- Learning and understanding of thread pool (with code examples)
- Tensorflow dynamically allocates video memory
- c语言语法基础之——指针(字符、一维数组) 学习
- TensorFlow遇到的各种错误
猜你喜欢
The basis of C language grammar -- pointer (multidimensional array, function, summary) learning
Internationalization configuration
#云原生征文# 在 Google Kubernetes Cluster 上使用 HANA Expression Database Service
【Leetcode】76. 最小覆盖子串
Cloud native essay using Hana expression database service on Google kubernetes cluster
Appium自动化测试基础 — 移动端测试环境搭建(二)
如何更改微信小程序二维码物料颜色
logback
Differences between JVM, Dalvik and art
The first batch of 12 enterprises settled in! Opening of the first time-honored product counter in Guangzhou
随机推荐
創建對象的時候堆內存的分配
定制拦截器
echo $?
Retrofit common request methods and comments, post, get heard file upload
Control setting layout in linear layout_ Gravity doesn't work?
Problems encountered by jupyter notebook
leetCode-链表的中间结点
字符串常量池、class常量池和运行时常量池
Redis novice introduction
c语言语法基础之——函数定义学习
Recyclerview implements flow layout (LinearLayout with line wrap) (flexboxlayoutmanager)
The basis of C language grammar -- learning of local variables and storage categories, global variables and storage categories, and macro definitions
Today's headline adaptation scheme code
Get the clicked position in the recyclerview
The basis of C language grammar -- function definition learning
Redis master-slave replication in win10 system
Does the go compiled executable have dynamic library links?
Testing practice - App testing considerations
SSM项目小例子,SSM整合图文详细教程
Omni channel, multi scenario and cross platform, how does app analyze channel traffic with data