mysql安装和完全卸载

######一、安装
1.查看是否已安装mysql
执行命令:yum list installed | grep mysql
提示:如果没有已安装的mysql,可继续执行下面步骤,如果发现有返回结果则翻到后面的卸载,完成卸载后在回来执行安装步骤

[root@dics-no ~]# yum list installed | grep mysql
[root@dics-no ~]# 

   
   
  • 1
  • 2

2.下载yum源文件
提示:根据具体需求选择下载哪个版本的源文件,可到http://repo.mysql.com/查看有哪些版本
执行命令:wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm

[root@dics-no ~]# wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
--2018-09-12 16:26:50--  http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
Resolving repo.mysql.com (repo.mysql.com)... 23.209.176.104
Connecting to repo.mysql.com (repo.mysql.com)|23.209.176.104|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 6140 (6.0K) [application/x-redhat-package-manager]
Saving to: ?.ysql-community-release-el7-5.noarch.rpm?

100%[=====================================================================================>] 6,140 --.-K/s in 0.002s

2018-09-12 16:26:51 (2.54 MB/s) - ?.ysql-community-release-el7-5.noarch.rpm?.saved [6140/6140]
[root@dics-no ~]#

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12

3.下载安装包
执行命令:rpm -ivh mysql-community-release-el7-5.noarch.rpm
提示:执行完命令后,查看下/etc/yum.repos.d/ 这个目录下多出mysql-community-source.repo和mysql-community.repo

[root@dics-no ~]# rpm -ivh mysql-community-release-el7-5.noarch.rpm
Preparing...                          ################################# [100%]
Updating / installing...
   1:mysql-community-release-el7-5    ################################# [100%]
[root@dics-no ~]# 

 
 
  • 1
  • 2
  • 3
  • 4
  • 5

4.查看是否已经有可安装的mysql包
执行命令:yum repolist all | grep mysql

[root@dics-no ~]# yum repolist all | grep mysql
mysql-connectors-community/x86_64 MySQL Connectors Community      enabled:    65
mysql-connectors-community-source MySQL Connectors Community - So disabled
mysql-tools-community/x86_64      MySQL Tools Community           enabled:    69
mysql-tools-community-source      MySQL Tools Community - Source  disabled
mysql55-community/x86_64          MySQL 5.5 Community Server      disabled
mysql55-community-source          MySQL 5.5 Community Server - So disabled
mysql56-community/x86_64          MySQL 5.6 Community Server      enabled:   412
mysql56-community-source          MySQL 5.6 Community Server - So disabled
mysql57-community-dmr/x86_64      MySQL 5.7 Community Server Deve disabled
mysql57-community-dmr-source      MySQL 5.7 Community Server Deve disabled
[root@dics-no ~]# 

 
 
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12

5.安装mysql
执行命令:yum install -y mysql-community-server

[root@dics-no ~]# yum install -y mysql-community-server
Loaded plugins: product-id, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Resolving Dependencies
--> Running transaction check
---> Package mysql-community-server.x86_64 0:5.6.41-2.el7 will be installed
--> Processing Dependency: mysql-community-common(x86-64) = 5.6.41-2.el7 for package: mysql-community-server-5.6.41-2.el7.x86_64
--> Processing Dependency: mysql-community-client(x86-64) >= 5.6.10 for package: mysql-community-server-5.6.41-2.el7.x86_64
--> Running transaction check
---> Package mysql-community-client.x86_64 0:5.6.41-2.el7 will be installed
--> Processing Dependency: mysql-community-libs(x86-64) >= 5.6.10 for package: mysql-community-client-5.6.41-2.el7.x86_64
---> Package mysql-community-common.x86_64 0:5.6.41-2.el7 will be installed
--> Running transaction check
---> Package mysql-community-libs.x86_64 0:5.6.41-2.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===============================================================================================================================
Package Arch Version Repository Size

Installing:
mysql-community-server x86_64 5.6.41-2.el7 mysql56-community 59 M
Installing for dependencies:
mysql-community-client x86_64 5.6.41-2.el7 mysql56-community 19 M
mysql-community-common x86_64 5.6.41-2.el7 mysql56-community 257 k
mysql-community-libs x86_64 5.6.41-2.el7 mysql56-community 2.0 M

Transaction Summary

Install 1 Package (+3 Dependent packages)

Total download size: 81 M
Installed size: 351 M
Downloading packages:
(1/4): mysql-community-common-5.6.41-2.el7.x86_64.rpm | 257 kB 00:00:01
(2/4): mysql-community-libs-5.6.41-2.el7.x86_64.rpm | 2.0 MB 00:00:02
(3/4): mysql-community-client-5.6.41-2.el7.x86_64.rpm | 19 MB 00:00:29
(4/4): mysql-community-server-5.6.41-2.el7.x86_64.rpm | 59 MB 00:00:56

Total 1.3 MB/s | 81 MB 00:01:01
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning: RPMDB altered outside of yum.
Installing : mysql-community-common-5.6.41-2.el7.x86_64 1/4
Installing : mysql-community-libs-5.6.41-2.el7.x86_64 2/4
Installing : mysql-community-client-5.6.41-2.el7.x86_64 3/4
Installing : mysql-community-server-5.6.41-2.el7.x86_64 4/4
Verifying : mysql-community-server-5.6.41-2.el7.x86_64 1/4
Verifying : mysql-community-client-5.6.41-2.el7.x86_64 2/4
Verifying : mysql-community-common-5.6.41-2.el7.x86_64 3/4
Verifying : mysql-community-libs-5.6.41-2.el7.x86_64 4/4

Installed:
mysql-community-server.x86_64 0:5.6.41-2.el7

Dependency Installed:
mysql-community-client.x86_64 0:5.6.41-2.el7 mysql-community-common.x86_64 0:5.6.41-2.el7
mysql-community-libs.x86_64 0:5.6.41-2.el7

Complete!
[root@dics-no ~]#

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64

6.启动mysql
执行命令:service mysqld start

[root@dics-no ~]# service mysqld start
Redirecting to /bin/systemctl start mysqld.service
[root@dics-no ~]# 

 
 
  • 1
  • 2
  • 3

7.修改root密码
依次执行以下命令:
mysql -u root
use mysql;
update user set password=PASSWORD(“root”) where User=‘root’;
提示:update user set password=PASSWORD(“这里输入root用户密码”) where User=‘root’;

[root@dics-no ~]# service mysqld start
Redirecting to /bin/systemctl start mysqld.service
[root@dics-no ~]# mysql -u root
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.6.41 MySQL Community Server (GPL)

Copyright © 2000, 2018, Oracle and/or its affiliates. All rights reserved.

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> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> update user set password=PASSWORD(“root”) where User=‘root’;
Query OK, 4 rows affected (0.00 sec)
Rows matched: 4 Changed: 4 Warnings: 0
mysql> exit
Bye
[root@dics-no ~]#

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27

8.查看是否开机自启
执行命令:
chkconfig --list | grep mysqld
chkconfig mysqld on

[root@dics-no ~]# chkconfig --list | grep mysqld

Note: This output shows SysV services only and does not include native
systemd services. SysV configuration data might be overridden by native
systemd configuration.

  If you want to list systemd services use 'systemctl list-unit-files'.
  To see services enabled on particular target use
  'systemctl list-dependencies [target]'.

[root@dics-no ~]# chkconfig mysqld on
Note: Forwarding request to ‘systemctl enable mysqld.service’.
[root@dics-no ~]#

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13

8.mysql安全设置
执行命令:mysql_secure_installation
提示:执行命令后会问你一些安全问题,根据实际需要选择y或n
######二、设置root的远程登录(根据需要)
执行命令:mysql -u root -p
然后输入root账号的密码进入mysql后依次执行以下命令
use mysql;
update user set host = ‘%’ where user = ‘root’;
提示:出现ERROR 1062 (23000): Duplicate entry ‘%-root’ for key ‘PRIMARY’ 不予理会
flush privileges;
select host, user from user;

mysql> update user set host = '%' where user = 'root';
ERROR 1062 (23000): Duplicate entry '%-root' for key 'PRIMARY'
mysql> select host, user from user;
+----------------------+------+
| host                 | user |
+----------------------+------+
| %                    | root |
| 127.0.0.1            | root |
| ::1                  | root |
| dics-no.01.novalocal | root |
+----------------------+------+
4 rows in set (0.00 sec)

mysql> flush privileges;

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14

######三、卸载

  1. 查看是否已安装mysql
    执行命令:yum list installed | grep mysql
[root@dics-no ~]# yum list installed | grep mysql
mysql-community-client.x86_64    5.6.41-2.el7                 @mysql56-community
mysql-community-common.x86_64    5.6.41-2.el7                 @mysql56-community
mysql-community-libs.x86_64      5.6.41-2.el7                 @mysql56-community
mysql-community-release.noarch   el7-5                        installed         
mysql-community-server.x86_64    5.6.41-2.el7                 @mysql56-community
[root@dics-no ~]# 

 
 
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7

2.删除已安装的mysql
执行命令:yum -y remove [第一步命令中出现的包名]

[root@dics-no ~]# yum list installed | grep mysql
mysql-community-client.x86_64    5.6.41-2.el7                 @mysql56-community
mysql-community-common.x86_64    5.6.41-2.el7                 @mysql56-community
mysql-community-libs.x86_64      5.6.41-2.el7                 @mysql56-community
mysql-community-release.noarch   el7-5                        installed         
mysql-community-server.x86_64    5.6.41-2.el7                 @mysql56-community
[root@dics-no ~]# yum -y remove mysql-community-client.x86_64 
Removed:
  mysql-community-client.x86_64 0:5.6.41-2.el7                                                                                 

Dependency Removed:
mysql-community-server.x86_64 0:5.6.41-2.el7

Complete!
[root@dics-no ~]# yum list installed | grep mysql
Removed:
mysql-community-common.x86_64 0:5.6.41-2.el7

Dependency Removed:
mysql-community-libs.x86_64 0:5.6.41-2.el7 postfix.x86_64 2:2.10.1-6.el7

Complete!
[root@dics-no ~]# yum list installed | grep mysql
mysql-community-release.noarch el7-5 installed
[root@dics-no ~]# yum -y remove mysql-community-release.noarch
Removed:
mysql-community-release.noarch 0:el7-5

Complete!
[root@dics-no ~]# yum list installed | grep mysql
[root@dics-no ~]#

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31

注:以上命令实际执行过程的输出比这里展示的要多,关键是要看到Removed和Complete的输出信息,且过程中没有报错。最后使用yum list installed | grep mysql命令查看,没有任何已安装的mysql组件即可!
3. 删除mysql相关文件
执行命令:find / -name mysql
提示:该命令是查找mysql的相关文件

[root@dics-no ~]# find / -name mysql
/etc/selinux/targeted/active/modules/100/mysql
/var/lib/mysql
/var/lib/mysql/mysql
/usr/share/mysql
[root@dics-no ~]# 

 
 
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6

执行命令:rm -rf [上面命令查出的结果目录]
提示:删除命令执行完之后,可再使用find / -name mysql 确认是否已经全部删除

[root@dics-no ~]# rm -rf /etc/selinux/targeted/active/modules/100/mysql
[root@dics-no ~]# rm -rf /var/lib/mysql
[root@dics-no ~]# rm -rf /var/lib/mysql/mysql
[root@dics-no ~]# rm -rf /usr/share/mysql
[root@dics-no ~]# find / -name mysql
[root@dics-no ~]# 

 
 
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6

4.可以回到安装步骤重新安装mysql了。

        </div>
					<link href="https://csdnimg.cn/release/phoenix/mdeditor/markdown_views-7b4cdcb592.css" rel="stylesheet">
            </div>
### RT-DETRv3 网络结构分析 RT-DETRv3 是一种基于 Transformer 的实时端到端目标检测算法,其核心在于通过引入分层密集正监督方法以及一系列创新性的训练策略,解决了传统 DETR 模型收敛慢和解码器训练不足的问题。以下是 RT-DETRv3 的主要网络结构特点: #### 1. **基于 CNN 的辅助分支** 为了增强编码器的特征表示能力,RT-DETRv3 引入了一个基于卷积神经网络 (CNN) 的辅助分支[^3]。这一分支提供了密集的监督信号,能够与原始解码器协同工作,从而提升整体性能。 ```python class AuxiliaryBranch(nn.Module): def __init__(self, in_channels, out_channels): super(AuxiliaryBranch, self).__init__() self.conv = nn.Conv2d(in_channels, out_channels, kernel_size=3, padding=1) self.bn = nn.BatchNorm2d(out_channels) def forward(self, x): return F.relu(self.bn(self.conv(x))) ``` 此部分的设计灵感来源于传统的 CNN 架构,例如 YOLO 系列中的 CSPNet 和 PAN 结构[^2],这些技术被用来优化特征提取效率并减少计算开销。 --- #### 2. **自注意力扰动学习策略** 为解决解码器训练不足的问题,RT-DETRv3 提出了一种名为 *self-att 扰动* 的新学习策略。这种策略通过对多个查询组中阳性样本的标签分配进行多样化处理,有效增加了阳例的数量,进而提高了模型的学习能力和泛化性能。 具体实现方式是在训练过程中动态调整注意力权重分布,确保更多的高质量查询可以与真实标注 (Ground Truth) 进行匹配。 --- #### 3. **共享权重解编码器分支** 除了上述改进外,RT-DETRv3 还引入了一个共享权重的解编码器分支,专门用于提供密集的正向监督信号。这一设计不仅简化了模型架构,还显著降低了参数量和推理时间,使其更适合实时应用需求。 ```python class SharedDecoderEncoder(nn.Module): def __init__(self, d_model, nhead, num_layers): super(SharedDecoderEncoder, self).__init__() decoder_layer = nn.TransformerDecoderLayer(d_model=d_model, nhead=nhead) self.decoder = nn.TransformerDecoder(decoder_layer, num_layers=num_layers) def forward(self, tgt, memory): return self.decoder(tgt=tgt, memory=memory) ``` 通过这种方式,RT-DETRv3 实现了高效的目标检测流程,在保持高精度的同时大幅缩短了推理延迟。 --- #### 4. **与其他模型的关系** 值得一提的是,RT-DETRv3 并未完全抛弃经典的 CNN 技术,而是将其与 Transformer 结合起来形成混合架构[^4]。例如,它采用了 YOLO 系列中的 RepNCSP 模块替代冗余的多尺度自注意力层,从而减少了不必要的计算负担。 此外,RT-DETRv3 还借鉴了 DETR 的一对一匹配策略,并在此基础上进行了优化,进一步提升了小目标检测的能力。 --- ### 总结 综上所述,RT-DETRv3 的网络结构主要包括以下几个关键组件:基于 CNN 的辅助分支、自注意力扰动学习策略、共享权重解编码器分支以及混合编码器设计。这些技术创新共同推动了实时目标检测领域的发展,使其在复杂场景下的表现更加出色。 ---
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值