8月5日学习笔记 glibc安装与安全用户角色权限

news2024/9/21 19:06:31

一,glibc安装

https://www.mysql.com/ 官⽹
https://downloads.mysql.com/archives/community/
https://downloads.mysql.com/archives/get/p/23/file/mysql-8.0.33-li
nux-glibc2.12-x86_64.tar
安装步骤

1.安装依赖库

[root@localhost ~]# yum list installed |grep libaio
libaio.x86_64 0.3.109-
13.el7 @anaconda
[root@localhost ~]#

2.解压查看

[root@localhost ~]# ls
mysql-8.0.33-linux-glibc2.12-x86_64.tar
[root@localhost ~]# tar -xvf mysql-8.0.33-linuxglibc2.12-x86_64.tar
mysql-8.0.33-linux-glibc2.12-x86_64.tar.xz
mysql-router-8.0.33-linux-glibc2.12-x86_64.tar.xz
[root@localhost ~]# tar -xvf mysql-8.0.33-linuxglibc2.12-x86_64.tar.xz
mysql-8.0.33-linux-glibc2.12-x86_64
[root@localhost ~]# ls mysql-8.0.33-linuxglibc2.12-x86_64/
bin docs include lib LICENSE man README 
share support-files
https://dev.mysql.com/doc/refman/8.0/en/binary-installation.html#
binary-installation-layout

3.创建⽤户

[root@localhost ~]# useradd -r -s /sbin/nologin
mysql
[root@localhost ~]# id mysql
uid=27(mysql) gid=27(mysql) 组=27(mysql)

4.清空其他环境 mariadb

[root@localhost ~]# rm -rf /etc/my.cnf

5.将解压文件放置在根目录下

[root@localhost ~]# mv mysql-8.0.33-linuxglibc2.12-x86_64/ /mysql8
[root@localhost ~]# ls /mysql8/
bin docs include lib LICENSE man README 
share support-files

6.切换mysql8⽬录,创建⼀个mysq-files

cd /mysql8/
mkdir mysql-files

7.修改mysql-files⽂件权限750和所属 mysql

[root@localhost mysql8]# chown mysql:mysql mysqlfiles/
[root@localhost mysql8]# chmod 750 mysql-files/
[root@localhost mysql8]# ls -l
总⽤量 296
drwxr-xr-x. 2 7161 31415 4096 3⽉ 17 2023 bin
drwxr-xr-x. 2 7161 31415 38 3⽉ 17 2023 docs
drwxr-xr-x. 3 7161 31415 4096 3⽉ 17 2023
include
drwxr-xr-x. 6 7161 31415 201 3⽉ 17 2023 lib
-rw-r--r--. 1 7161 31415 284945 3⽉ 17 2023
LICENSE
drwxr-xr-x. 4 7161 31415 30 3⽉ 17 2023 man
drwxr-x---. 2 mysql mysql 6 8⽉ 3 22:30
mysql-files
-rw-r--r--. 1 7161 31415 666 3⽉ 17 2023
README
drwxr-xr-x. 28 7161 31415 4096 3⽉ 17 2023
share
drwxr-xr-x. 2 7161 31415 77 3⽉ 17 2023
support-files

8.初始化数据库,找到初始密码

[root@localhost mysql8]# ./bin/mysqld --initialize
--user=mysql --basedir=/mysql8
2024-08-03T14:34:53.993391Z 0 [System] [MY-013169]
[Server] /mysql8/bin/mysqld (mysqld 8.0.33)
initializing of server in progress as process 2236
2024-08-03T14:34:54.003043Z 1 [System] [MY-013576]
[InnoDB] InnoDB initialization has started.
2024-08-03T14:34:55.674077Z 1 [System] [MY-013577]
[InnoDB] InnoDB initialization has ended.
2024-08-03T14:34:58.133984Z 6 [Note] [MY-010454]
[Server] A temporary password is generated for
root@localhost: .I//GqI,Z2-k

9.查看是否初始化成功过,可以看⽂件夹中

是否有data⽂件夹

[root@localhost mysql8]# ls
bin docs lib man README 
support-files
data include LICENSE mysql-files share

10.设置ssl安全加密连接 敏感数据

[root@localhost mysql8]# ls ./bin/*ssl*
./bin/mysql_ssl_rsa_setup
[root@localhost mysql8]# ./bin/mysql_ssl_rsa_setup
--datadir=/mysql8/data
[root@localhost mysql8]# ls ./data/
auto.cnf #ib_16384_1.dblwr mysql.ibd 
 sys
ca-key.pem ib_buffer_pool 
performance_schema undo_001
ca.pem ibdata1 
private_key.pem undo_002
client-cert.pem #innodb_redo 
public_key.pem
client-key.pem #innodb_temp servercert.pem
#ib_16384_0.dblwr mysql serverkey.pem

11.其他配置

[root@localhost mysql8]# cp supportfiles/mysql.server /etc/init.d/mysql8
[root@localhost mysql8]# ls /etc/init.d/mysql8
/etc/init.d/mysql8
[root@localhost mysql8]# ls /etc/init.d/
functions mysql8 mysql8ls netconsole network 
README
[root@localhost mysql8]#
# 默认情况下,启动⽂件认识安装⽬录在/usr/local/⽬录下
[root@localhost mysql8]# sed -n '/^basedir=/p'
/etc/init.d/mysql8
basedir=
[root@localhost mysql8]# sed -i
'/^basedir=/cbasedir=/mysql8' /etc/init.d/mysql8
[root@localhost mysql8]# sed -n '/^basedir=/p'
/etc/init.d/mysql8
basedir=/mysql8
[root@localhost mysql8]# sed -n '/^datadir=/p'
/etc/init.d/mysql8
datadir=
[root@localhost mysql8]# sed -i
'/^datadir=/cdatadir=/mysql8/data'
/etc/init.d/mysql8
[root@localhost mysql8]# sed -n '/^datadir=/p'
/etc/init.d/mysql8
datadir=/mysql8/data
[root@localhost mysql8]#

12.启动服务 不能使⽤systemctl

ot@localhost mysql8]# service mysql8 start
Starting MySQL.Logging to
'/mysql8/data/localhost.localdomain.err'.
.. SUCCESS!
[root@localhost mysql8]# ls /mysql8/data/*.err
/mysql8/data/localhost.localdomain.err
# 启动成功后会⽣成err⽇志⽂件,多看看,了解启动的详细原因

13.常⻅问题

1. 为什么要删除/etc/my.cnf⽂件
```
数据库初始化时候,会⾃动找my.cnf配置,但是原有的mariadb配
置⽂件,会失败
```
2. mysql-files⽂件夹
```
⽬前么有⽤,必须创建,可能导致⽆法启动,数据的备份和还原,导
⼊和到处所指定的默认⽬录
```
3. 判断数据库初始化成功
```
数据库的安装容易出错的地⽅是初始化,⽆法正常启动,确认⽅式
安装⽬录下是否⽣成data⽬录
```
4. 为什么要修改mysql.server放在/etc/init.d⽬录下
```
不放也可以,但是就⽆法使⽤service mysql8 start启动
只能使⽤bin/mysqld可执⾏⽂件启动
```
5. 为什么需要修改basedir和datadir
```
glibc是⼆进制绿⾊版本,默认配置很多,需要修改
```
6. 开机启动
```shell
[root@localhost mysql8]# chkconfig --list
注:该输出结果只显示 SysV 服务,并不包含
原⽣ systemd 服务。SysV 配置数据
可能被原⽣ systemd 配置覆盖。
 要列出 systemd 服务,请执⾏ 'systemctl listunit-files'。
 查看在具体 target 启⽤的服务请执⾏
 'systemctl list-dependencies [target]'。
netconsole 0:关 1:关 2:关 3:关 4:关 5:关 6:关
network 0:关 1:关 2:开 3:开 4:开 5:开 6:关
# 添加开机启动
[root@localhost mysql8]# chkconfig --add mysql8
#查看启动该列表
[root@localhost mysql8]# chkconfig --list
注:该输出结果只显示 SysV 服务,并不包含
原⽣ systemd 服务。SysV 配置数据
可能被原⽣ systemd 配置覆盖。
 要列出 systemd 服务,请执⾏ 'systemctl listunit-files'。
 查看在具体 target 启⽤的服务请执⾏
 'systemctl list-dependencies [target]'。
mysql8 0:关 1:关 2:开 3:开 4:开 5:开 6:关
netconsole 0:关 1:关 2:关 3:关 4:关 5:关 6:关
network 0:关 1:关 2:开 3:开 4:开 5:开 6:关
# 启动2345
[root@localhost mysql8]# chkconfig mysql8 on
[root@localhost mysql8]# chkconfig --list
注:该输出结果只显示 SysV 服务,并不包含
原⽣ systemd 服务。SysV 配置数据
可能被原⽣ systemd 配置覆盖。
 要列出 systemd 服务,请执⾏ 'systemctl listunit-files'。
 查看在具体 target 启⽤的服务请执⾏
 'systemctl list-dependencies [target]'。
mysql8 0:关 1:关 2:开 3:开 4:开 5:开 6:关
netconsole 0:关 1:关 2:关 3:关 4:关 5:关 6:关
network 0:关 1:关 2:开 3:开 4:开 5:开 6:关
# 3是字符界⾯,5是图形界⾯
```## 14 .mysql glibc版本后续设置
1. 修改密码1
 ```shell
 [root@localhost mysql8]# ./bin/mysqladmin -uroot
password '123' -p
 Enter password:
 mysqladmin: [Warning] Using a password on the
command line interface can be insecure.
 Warning: Since password will be sent to server
in plain text, use ssl connection to ensure
password safety.
[root@localhost mysql8]# ./bin/mysql -uroot -p
Enter password: # 输⼊123
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 10
Server version: 8.0.33 MySQL Community Server - GPL
Copyright (c) 2000, 2023, Oracle and/or its
affiliates.
 Oracle is a registered trademark of Oracle
Corporation and/or its
 affiliates. Other names may be trademarks of
their respective
 owners.
 Type 'help;' or '\h' for help. Type '\c' to
clear the current input statement.
 mysql>
2. 修改密码2
 ```shell
 mysql> set password='456';
 Query OK, 0 rows affected (0.02 sec)
 mysql> flush privileges;
 Query OK, 0 rows affected (0.01 sec)
[root@localhost mysql8]# ./bin/mysql -uroot -p456
mysql: [Warning] Using a password on the command line
interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 11
Server version: 8.0.33 MySQL Community Server - GPL
 Copyright (c) 2000, 2023, Oracle and/or its
affiliates.
 Oracle is a registered trademark of Oracle
Corporation and/or its
 affiliates. Other names may be trademarks of
their respective
 owners.
 Type 'help;' or '\h' for help. Type '\c' to
clear the current input statement.
 mysql>
 ```
3. 将mysql的bin⽬录添加到环境变量中
 ```shell
 [root@localhost mysql8]# sed -i '$aexport
PATH=/mysql8/bin/:$PATH' /etc/profile
 [root@localhost mysql8]# sed -n '$p'
/etc/profile
 export PATH=/mysql8/bin/:$PATH
 [root@localhost mysql8]# source /etc/profile
 [root@localhost mysql8]# which mysql
 /mysql8/bin/mysql
 [root@localhost mysql8]# mysqld
 2024-08-03T15:53:05.871244Z 0 [System] [MY-
010116] [Server] /mysql8/bin/mysqld (mysqld 8.0.33)
starting as process 2861
 2024-08-03T15:53:05.874283Z 0 [ERROR] [MY-
010123] [Server] Fatal error: Please read
"Security" section of the manual to find out how to
run mysqld as root!
 2024-08-03T15:53:05.874333Z 0 [ERROR] [MY-
010119] [Server] Aborting
 2024-08-03T15:53:05.874776Z 0 [System] [MY-
010910] [Server] /mysql8/bin/mysqld: Shutdown
complete (mysqld 8.0.33) MySQL Community Server -
GPL.
 [root@localhost mysql8]#
 ```
4. 配置⽂件
 ```shell
 [root@localhost mysql8]# fg
 vim ./my.cnf
 [mysqld]
 basedir=/mysql8
 datadir=/mysql8/data
 socket=/tmp/mysql.sock
#重启服务
[root@localhost mysql8]# service mysql8 restart
Shutting down MySQL.. SUCCESS!
Starting MySQL.. SUCCESS!
 # 查看套接字⽂件
 [root@localhost mysql8]# ll /tmp/
总⽤量 12
 -rwx------. 1 root root 836 8⽉ 2 23:02 ksscript-64N_oN
 srwxrwxrwx. 1 mysql mysql 0 8⽉ 4 00:02
mysql.sock
 -rw-------. 1 mysql mysql 5 8⽉ 4 00:02
mysql.sock.lock
 srwxrwxrwx. 1 mysql mysql 0 8⽉ 4 00:02
mysqlx.sock
 -rw-------. 1 mysql mysql 5 8⽉ 4 00:02
mysqlx.sock.lock
 drwx------. 3 root root 17 8⽉ 3 20:49
systemd-private-23259a7f757e44ec9ab58b88e07ceefachronyd.service-poengE
 -rw-------. 1 root root 0 8⽉ 2 22:58
yum.log

# 有套接字⽂件,就可以链接mysql服务
[root@localhost mysql8]# mysql -uroot -p456
mysql: [Warning] Using a password on the command line
interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.33 MySQL Community Server - GPL
Copyright (c) 2000, 2023, Oracle and/or its
affiliates.
Oracle is a registered trademark of Oracle
Corporation and/or its
affiliates. Other names may be trademarks of
their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to
clear the current input statement.
mysql>
```

14. 安全配置 ⽣产环境

[root@localhost mysql8]# mysql_secure_installation
# ⼀路y下去 改密码,不允许远程等等
Securing the MySQL server deployment.
Enter password for user root:
VALIDATE PASSWORD COMPONENT can be used to test
passwords
and improve security. It checks the strength of
password
and allows the users to set only those passwords
which are
secure enough. Would you like to setup VALIDATE
PASSWORD component?
Press y|Y for Yes, any other key for No:
Using existing password for root.
Change the password for root ? ((Press y|Y for Yes,
any other key for No) : y
New password:
Re-enter new password:
Sorry, passwords do not match.
New password:
Re-enter new password:
By default, a MySQL installation has an anonymous
user,
allowing anyone to log into MySQL without having to
have
a user account created for them. This is intended
only for
testing, and to make the installation go a bit
smoother.
You should remove them before moving into a
production
environment.
Remove anonymous users? (Press y|Y for Yes, any
other key for No) : y
Success.
Normally, root should only be allowed to connect
from
'localhost'. This ensures that someone cannot guess
at
the root password from the network.
Disallow root login remotely? (Press y|Y for Yes,
any other key for No) : y
Success.
By default, MySQL comes with a database named
'test' that
anyone can access. This is also intended only for
testing,
and should be removed before moving into a
production
environment.
Remove test database and access to it? (Press y|Y
for Yes, any other key for No) : y
- Dropping test database...
Success.
- Removing privileges on test database...
Success.
Reloading the privilege tables will ensure that all
changes
made so far will take effect immediately.
Reload privilege tables now? (Press y|Y for Yes,
any other key for No) : y
Success.
All done!
[root@localhost mysql8]# mysql -uroot -p456
mysql: [Warning] Using a password on the command
line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ;
or \g.
Your MySQL connection id is 11
Server version: 8.0.33 MySQL Community Server - GPL
Copyright (c) 2000, 2023, Oracle and/or its
affiliates.
Oracle is a registered trademark of Oracle
Corporation and/or its
affiliates. Other names may be trademarks of their
respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear
the current input statement.
mysql> quit
Bye
[root@localhost mysql8]#

二,安全用户角色权限

$PATH
搞系统设置设置⾥头path
⽬标包含mysql 可执⾏⽂件,那么就是由使⽤
在终端使⽤
./bin/mysql -h192.168.71.164 -P3306 -uroot -proot
1.远程登录前提条件是mysql.user表中的host属性为%,如果是
localhost就不允许远程登录,update mysql.user set host="%"
where user="root",flush privileges;
2.远程管理,可以使⽤图形化⼯具,sqlyog,navicat,掌握命令⼯
具,客户端⼯具 mysql
3.mysql -h192.168.71.129 -P3306 -uzhangmin -pZhang_min123
-h 主机 ip或者是域名 如果是localshost或者是127.0.0.1可省略
-P 端⼝ 默认是3306,如果是默认的,可以省略-u ⽤户名
-p 密码,可以不换⾏直接输⼊,也可以换⾏ 不回显输⼊密码
创建账户
create user 'zhangmin'@'%' identified by
'Zhang_min123';
给权限
grant all on *.* to 'zhangmin'
创建库
create database if not exists test;
创建表
use test;
create table user(
 id int primary key,
 username varchar(45) not null,
 password varchar(45) not null
);
添加数据
insert into test.user values(1,"zhangsan","123");
insert into test.user values(2,"lisi","456");
insert into test.user values(3,"wamngwi","789");
insert into test.user values(4,"zhaoliu","aaa");
添加lilaosi账号,修改密码,查看mysql.user中的lilaosi的信息
mysql> create user 'lilaosi'@'%' identified by
'lilaoshi_123';
ERROR 1819 (HY000): Your password does not satisfy
the current policy requirements
mysql> create user 'lilaosi'@'%' identified by
'Lilaoshi_123';
Query OK, 0 rows affected (0.01 sec)
mysql> alter user 'lilaosi'@'%' identified by
'Lilaosi_123';
Query OK, 0 rows affected (0.01 sec)
mysql> select host,user from mysql.user;
+-----------+------------------+
| host | user |
+-----------+------------------+
| % | lilaosi |
| % | root |
| % | zhangmin |
| localhost | mysql.infoschema |
| localhost | mysql.session |
| localhost | mysql.sys |
+-----------+------------------+
6 rows in set (0.00 sec)
使⽤root账号,为lilaosi账号添加test库存中所有的表的所有权限
grant all on test.* to 'lilaosi';
# lilaosi就获得了test库中所有的表的操作权限,但是,由于
root没有个lilaosimysql库的权限,所以lilaosi账号⽆法查看
mysql库

1.密码安全策略

查看密码策略

mysql> show variables like 'validate%';
+--------------------------------------+--------+
| Variable_name | Value |
+--------------------------------------+--------+
| validate_password.check_user_name | ON |
| validate_password.dictionary_file | |
| validate_password.length | 8 |
| validate_password.mixed_case_count | 1 |
| validate_password.number_count | 1 |
| validate_password.policy | MEDIUM |
| validate_password.special_char_count | 1 |
+--------------------------------------+--------+
7 rows in set (0.00 sec)
修改策略
mysql> set global validate_password.length=0;
mysql> set global validate_password.policy=LOW;
mysql> show variables like 'validate%';
+--------------------------------------+-------+
| Variable_name | Value |
+--------------------------------------+-------+
| validate_password.check_user_name | ON |
| validate_password.dictionary_file | |
| validate_password.length | 4 |
| validate_password.mixed_case_count | 0 |
| validate_password.number_count | 0 |
| validate_password.policy | LOW |
| validate_password.special_char_count | 0 |
+--------------------------------------+-------+

2.⽤户

创建⽤户
练习
创建三个账号,abc[abcd],ccc[a1b2c3] ,ddd[231343]
<mysql> create user 'efg'@'%' identified by 'efg';
ERROR 1819 (HY000): Your password does not satisfy
the current policy requirements
mysql> create user 'efgh'@'%' identified by 'efgh';
Query OK, 0 rows affected (0.01 sec)
mysql> select host,user from mysql.user;
+-----------+------------------+
| host | user |
+-----------+------------------+
| % | efgh |
| % | root |
| % | zhangmin |
| localhost | mysql.infoschema |
| localhost | mysql.session |
| localhost | mysql.sys |
| localhost | test1 |
+-----------+------------------+
删除⽤户
mysql> drop user 'zhangmin';
Query OK, 0 rows affected (0.02 sec)
mysql> select user from mysql.user;
+------------------+
| user |
+------------------+
| efgh |
| root |
| mysql.infoschema |
| mysql.session |
| mysql.sys |
| test1 |
+------------------+
6 rows in set (0.00 sec)
修改⽤户
mysql> alter user 'zhangmin' identified by
'abc123';
Query OK, 0 rows affected (0.01 sec)
练习
abc。ccc。ddd三个账号的密码修改为1234
查看⽤户

3.⻆⾊

创建⻆⾊
mysql> create role 'a';
Query OK, 0 rows affected (0.00 sec)
mysql> show grants for 'a';
+-------------------------------+
| Grants for a@% |
+-------------------------------+
| GRANT USAGE ON *.* TO `a`@`%` |
+-------------------------------+
1 row in set (0.00 sec)
练习
1.添加jingli⻆⾊
create role 'jingli';
2.添加yuangong⻆⾊
craete role 'yaungong';
3.为jingli添加select insert delete update权限
grant select ,insert,delete,update on test.user to
'jingli';
4.为yuangong添加select,insert权限
grant select,insert on test.user to 'yuangong';
5.查看⻆⾊保存的表格
selet host,user from mysql.user;
6.查看⻆⾊的权限
show grants for 'jingli';
show grants for 'yaungogng';
新增bbb和ccc两个⽤户bbb是经理需要增删改查权限,ccc是员⼯是
只需要新增和查看的权限
grant jingli to ‘bbb’;
grant yuangong to 'ccc';

4.权限

刷新权限
mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)
为root账号添加权限
mysql> grant system_user on *.* to "root";
mysql> show grants for 'root';
+--------------------------------------------------
---------------------------------------------------
---------------------------------------------------
---------------------------------------------------
---------------------------------------------------
---------------------------------------------------
---------------------------------------------------
------------------------------+
| Grants for root@%
|
+--------------------------------------------------
---------------------------------------------------
---------------------------------------------------
---------------------------------------------------
---------------------------------------------------
---------------------------------------------------
---------------------------------------------------
------------------------------+
| GRANT SELECT, INSERT, UPDATE, DELETE, CREATE,
DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES,
INDEX, ALTER, SHOW DATABASES, SUPER, CREATE
TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION
SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW,
CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT,
TRIGGER, CREATE TABLESPACE, CREATE ROLE, DROP ROLE
ON *.* TO `root`@`%` WITH GRANT OPTION |
| GRANT SYSTEM_USER ON *.* TO `root`@`%`
|
+--------------------------------------------------
---------------------------------------------------
---------------------------------------------------
---------------------------------------------------
---------------------------------------------------
---------------------------------------------------
---------------------------------------------------
------------------------------+
2 rows in set (0.00 sec)
修改权限
mysql> show grants for "efgh";
+--------------------------------------------------
-+
| Grants for efgh@%
|
+--------------------------------------------------
-+
| GRANT SELECT, INSERT, DELETE ON *.* TO `efgh`@`%`
|
+--------------------------------------------------
-+
1 row in set (0.00 sec)
练习步骤
1.添加aaa账户,设置密码aaaa
drop user aaa;
create user 'aaa'@'%' identified by 'aaaa';
2.使⽤aaa账户访问mysql服务
mysql -h127.0.0.1 -P3306 -uaaa -paaaa
3.查看test数据库发现么有权限
show databases;
4.退出并使⽤root账户登录
quit|exit
mysql -h127.0.0.1 -P3306 -uroot -proot0000
5.为aaa账户添加查看test.user表的权限
grant select on test.user to 'aaa';
6.退出root,使⽤aaa账户登录
quit|exit
mysql -h127.0.0.1 -P3306 -uaaa -paaaa
7.查看数据库,查看表,查看表内容 能够正常查看
show databases;
user test;
show tables;
select * from user;
8.输⼊数据,没有权限
insert into user values(5,"ermazi","ermazi");####
9.退出aaa使⽤root登录
quit|exit
mysql -h127.0.0.1 -P3306 -uroot -proot0000
10.为aaa添加insert权限
grant insert on test.user to 'aaa';
11.退出root使⽤aaa登录
exit|quit
mysql -h127.0.0.1 -P3306 -uaaa -paaaa
12.向user表添加⼀⾏新的数据
insert into test.user
values(6,"zhangsanfeng","zhangsanfen");
13.修改user中⼀⾏的数据的password(密码)为111,没有
update权限
update test.user set password='zsf' where username-
'zhangsanfeng';
删除权限
mysql> revoke all on *.* from "efgh";
Query OK, 0 rows affected (0.00 sec)
mysql> show grants for "efgh";
+----------------------------------+
| Grants for efgh@% |
+----------------------------------+
| GRANT USAGE ON *.* TO `efgh`@`%` |
+----------------------------------+
1 row in set (0.00 sec)

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1994414.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

在vscode中使用ssh运行docker:从下载到运行全流程

首先在本机或者服务器上下载docker并运行 本文目的旨在本机下载docker并打包&#xff0c;然后在服务器上进行加载 docker -v Docker version 27.0.3, build 7d4bcd8有输出说明在运行 一、下载 在docker hub上下载docker以tensorflow为例 点击tag搜索自己想要的版本 copy命…

All-Reduce通信原语;Reduce+LayerNorm+Broadcast算子;gRPC:远程过程调用(RPC)框架;

目录 All-Reduce通信原语 定义与作用 实例说明 示例图解(以Ring算法为例) 结论 Reduce+LayerNorm+Broadcast算子 1. Reduce算子 2. LayerNorm算子 3. Broadcast算子 组合使用场景 gRPC:远程过程调用(RPC)框架 All-Reduce通信原语 是计算机科学中,特别是在分布式…

解锁成都跃享未来教育咨询抖音小店

在数字化浪潮汹涌的今天&#xff0c;教育行业的变革与创新层出不穷&#xff0c;其中&#xff0c;成都跃享未来教育咨询以其敏锐的洞察力和前瞻性的教育理念&#xff0c;在抖音平台上开设的小店&#xff0c;正悄然改变着人们的学习方式和教育资源的获取途径。本文将深入探讨成都…

骰子游戏的UML分析

一、需求分析 游戏者掷两个骰子,如果总点数是7则赢得游戏,否则为输 二、概要设计 2.1 设计用例 用例是基于某个场景(注:包括成功和失败场景,重要体现需求的边界)说明了用户如何通过系统实现实现其目标。 示例:玩游戏场景用例 用例名称:玩游戏 主要参与者: 游戏用户 前…

实时数据监控,三防平板在工业领域的应用解析

随着工业4.0时代的到来&#xff0c;数字化转型已成为各行各业的共同目标。在这一过程中&#xff0c;实时数据监控扮演着至关重要的角色&#xff0c;为企业提供数据驱动的决策支持&#xff0c;提升效率、降低成本、提高安全性。而作为移动终端设备&#xff0c;三防平板凭借其可靠…

深兰科技荣获2024年度金势奖“AI出海先锋品牌”金奖

近日&#xff0c;由金势奖组委会、凤凰网、营销国际协会等国内外知名机构、集团共同主办的“第四届未来营销大会暨锐品牌盛典”在上海举行。大会揭晓了第四届“金势奖锐品牌大赏”奖项的评选结果&#xff0c;深兰科技凭借自身在机器人产品出口和海外市场开拓等出海全球化发展方…

2-59 基于matlab的全离散法单自由度稳定极限切深叶瓣图绘制、两自由度稳定极限切深叶瓣图绘制

基于matlab的全离散法单自由度稳定极限切深叶瓣图绘制、两自由度稳定极限切深叶瓣图绘制&#xff0c;特定切削力系数进行数值积分。输出相应的叶瓣图。程序已调通&#xff0c;可直接运行。 2-59 两自由度稳定极限切深叶瓣图 - 小红书 (xiaohongshu.com)

【计算机组成原理】3.程序的执行

程序的执行 进程与线程 一个程序&#xff0c;读入内存&#xff0c;全是0和1构成 从内存读入到CPU计算&#xff0c;这个时候要通过总线 怎么区分一段01的数据到底是数据还是指令&#xff1f; 总线分类为三种&#xff1a;控制线 地址线 数据线 一个程序的执行&#xff0c;首…

美团创始人的亲授产品课

2020年王慧文受邀在清华大学演讲了个人的非产品公开课&#xff0c;课程内容以美团早期的实战经验结合规模效益、马太理论等诸多知名理论为主。 前两天重新翻阅的时候&#xff0c;还是有很多新的感悟&#xff0c;所以也借此机会把课程内容和大家分享一下。 规模效益 一个业务有…

视频压缩文件太大了怎么缩小?这6个视频压缩方法真有效

视频压缩文件太大了怎么缩小&#xff1f;视频文件太大不仅会占据磁盘空间&#xff0c;而且会影响分享传输&#xff0c;因此太大的视频文件我们可以通过压缩缩小来减少体积&#xff0c;那么要怎么压缩视频文件大小呢&#xff1f;在这里小编要分享亲测有用的6个视频压缩方法&…

EF8 学习过程中的问题和解决方案

一、varchar类型字段如果为null 无法使用contains来判断是否包含字符串 1. 有问题的代码&#xff1a; contractList _dbcontext.contractHeads.Where(u > u.code.Contains(queryStr) || u.name.Contains(queryStr) || u.companyName.Contains(queryStr) || u.customerNa…

Linux 内核源码分析---挂载文件系统

挂载描述符 Linux 操作系统的一个文件系统&#xff0c;只有挂载到内存中目录树的一个目录下&#xff0c;进程才能够访问这个文件系统。 每次挂载文件系统&#xff0c;虚拟文件系统就会创建一个挂载描述符&#xff08;mount 结构体&#xff09;。 挂载描述符用来描述文件系统的…

CSS 多按钮根据半圆弧度排列

需求 多个按钮根据弧度&#xff0c;延边均匀排列。 实现 HTML 分两级&#xff1b;第一级&#xff0c;外层定义按钮的 compose-container 宽度&#xff1b;第二级&#xff0c;按钮集合&#xff0c;使用方法 styleBtn(index)&#xff0c;根据索引计算&#xff1b; <div c…

原理图与 PCB设计核心指南!

这篇文章献给从事电子信息行业的硬件工程师、射频工程和PCB工程师&#xff0c;若有不足之处&#xff0c;请多多包涵&#xff01; 原理图设计原理 原理图设计是电子设计的核心环节&#xff0c;它为后续的 PCB 设计、生产、调试等流程奠定了坚实基础。深入理解原理图设计的原理及…

【Hot100】LeetCode—124. 二叉树中的最大路径和

1- 思路 使用递归 dfs 实现① 递归思路&#xff1a;每次递归返回值为 &#xff0c; root.valMath.max(left,right) 从 左右孩子中挑选一个大的。② 递归公式&#xff1a;定义 sum&#xff0c;sum root.val left right 2- 实现 ⭐124. 二叉树中的最大路径和——题解思路 cl…

如何使用调查问卷获得需求

通过调查问卷进行需求调研是个效率非常高的方法&#xff0c;也是需求调研常用的方法。对于调研者&#xff0c;不必跑到工作现场&#xff0c;不必跟一个又一个用户一遍又一遍地沟通&#xff0c;只要编写调查问卷&#xff0c;让甲方对接人安排人回答&#xff0c;然后分析答卷就可…

基于区块链的合同存证应用开发

基于区块链的合同存证应用开发 任务一:环境准备 1.启动区块链网络 目录: /root/xuperchain/output/ 启动区块链网络 bash constrol.sh start2.创建钱包账户 目录: /root/xuperchain/output/ 创建tenant, landlord钱包账户,命令如下: bin/xchain-cli account newke…

基于 SpringBoot 的 会员制医疗预约服务管理信息系统

开发技术 JavaMySQLSpringBoot 系统分析 需求分析 会员制医疗预约服务管理信息系统的作用&#xff0c;可以提高会员制医疗预约服务管理的工作人员的效率&#xff0c;协助他们对会员制医疗预约服务信息进行统一管理&#xff0c;为管理者提供信息储存和查询搜索系统。一个良好…

【LVS】部署DR模式集群

一、配置实验环境 每台主机的防火墙和SELinux都要关掉 systemctl stop firewalld setenforce 0 1、client(eth0为nat模式) 配置好网卡IP和网关IP&#xff0c;然后重启网卡 nmcli connection reload nmcli connection up eth0 [rootclient ~]# cat /etc/NetworkManager/syst…

AI赋能周界安防:智能视频分析技术构建无懈可击的安全防线

周界安全防范是保护机场、电站、油库、监狱、工业园区等关键设施免受非法入侵和破坏的重要措施。传统的周界安防手段主要依靠人员巡查和物理屏障&#xff0c;但这种方式不仅人力成本高&#xff0c;而且效率较低&#xff0c;难以满足日益复杂多变的安全需求。随着AI技术的引入&a…