8.6-设置mysql开机自启+角色生效+主从数据库

一、设置mysql开机自启

1.添加开机自启

#添加开机启动
[root@004 mysql]# #systemctl enable mysqld
[root@004 mysql]# chkconfig --list注:该输出结果只显示 SysV 服务,并不包含
原生 systemd 服务。SysV 配置数据
可能被原生 systemd 配置覆盖。 ```要列出 systemd 服务,请执行 'systemctl list-unit-files'。查看在具体 target 启用的服务请执行'systemctl list-dependencies [target]'。
```netconsole     	0:关	1:关	2:关	3:关	4:关	5:关	6:关
network        	0:关	1:关	2:开	3:开	4:开	5:开	6:关
[root@004 mysql]# chkconfig --add mysql8
[root@004 mysql]# chkconfig --list注:该输出结果只显示 SysV 服务,并不包含
原生 systemd 服务。SysV 配置数据
可能被原生 systemd 配置覆盖。 ```要列出 systemd 服务,请执行 'systemctl list-unit-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:关

2.修改配置文件

[root@004 mysql]# vim /usr/local/mysql/my.cnf
[mysqld]
basedir=/usr/local/mysql
datadir=/usr/local/mysql/data
socket=/tmp/mysql.sock

3.重启服务

[root@004 mysql]# service mysql8 restart
Shutting down MySQL.. SUCCESS! 
Starting MySQL.. SUCCESS! 

4.mysql安全设置

[root@004 mysql]# /usr/local/mysql/bin/mysql_secure_installation 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: n
Using existing password for root.
Change the password for root ? ((Press y|Y for Yes, any other key for No) : n... skipping.
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! 

5.配置/etc/profile文件

# 将mysql的bin也添加到
[root@004 mysql]# #$PATH
[root@004 mysql]# #/etc/profile
[root@004 mysql]# sed -i '$aexport PATH=/usr/local/mysql/bin/:$PATH' /etc/profile
[root@004 mysql]# sed -n '$p' /etc/profile
export PATH=/usr/local/mysql/bin/:$PATH
[root@004 mysql]# source /etc/profile
[root@004 mysql]# mysql -pHui@2003

5.创建aaa账号

mysql> select host,user from mysql.user;
+-----------+------------------+
| host      | user             |
+-----------+------------------+
| localhost | mysql.infoschema |
| localhost | mysql.session    |
| localhost | mysql.sys        |
| localhost | root             |
+-----------+------------------+
4 rows in set (0.00 sec)mysql> create user 'aaa'@'%' identified by 'aaaa';
Query OK, 0 rows affected (0.02 sec)mysql> select host,user from mysql.user;
+-----------+------------------+
| host      | user             |
+-----------+------------------+
| %         | aaa              |
| localhost | mysql.infoschema |
| localhost | mysql.session    |
| localhost | mysql.sys        |
| localhost | root             |
+-----------+------------------+
5 rows in set (0.00 sec)mysql> quit
Bye

6.打开端口

[root@004 mysql]# #打开防火墙或者端口
[root@004 mysql]# firewall-cmd --zone=public --add-port=3306/tcp --permanent 
success
[root@004 mysql]# firewall-cmd --reload
success

7.创建角色a

[root@004 mysql]# mysql -pHui@2003
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 12
Server version: 8.0.33 MySQL Community Server - GPLCopyright (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> create role a;
Query OK, 0 rows affected (0.00 sec)mysql> select host,user from mysql.user;
+-----------+------------------+
| host      | user             |
+-----------+------------------+
| %         | a                |
| %         | aaa              |
| localhost | mysql.infoschema |
| localhost | mysql.session    |
| localhost | mysql.sys        |
| localhost | root             |
+-----------+------------------+
6 rows in set (0.00 sec)

8.查询角色a的权限

mysql> show grants for a;
+-------------------------------+
| Grants for a@%                |
+-------------------------------+
| GRANT USAGE ON *.* TO `a`@`%` |
+-------------------------------+
1 row in set (0.00 sec)

9.给角色a添加所有的权限

mysql> grant all on *.* to a;
Query OK, 0 rows affected (0.01 sec)mysql> show grants for a;
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Grants for a@%                                                                                                                                                                                                                                                  |
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| 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 `a`@`%`                                                                                     |
| GRANT APPLICATION_PASSWORD_ADMIN,AUDIT_ABORT_EXEMPT,AUDIT_ADMIN,AUTHENTICATION_POLICY_ADMIN,BACKUP_ADMIN,BINLOG_ADMIN,BINLOG_ENCRYPTION_ADMIN,CLONE_ADMIN,CONNECTION_ADMIN,ENCRYPTION_KEY_ADMIN,FIREWALL_EXEMPT,FLUSH_OPTIMIZER_COSTS,FLUSH_STATUS,FLUSH_TABLES,FLUSH_USER_RESOURCES,GROUP_REPLICATION_ADMIN,GROUP_REPLICATION_STREAM,INNODB_REDO_LOG_ARCHIVE,INNODB_REDO_LOG_ENABLE,PASSWORDLESS_USER_ADMIN,PERSIST_RO_VARIABLES_ADMIN,REPLICATION_APPLIER,REPLICATION_SLAVE_ADMIN,RESOURCE_GROUP_ADMIN,RESOURCE_GROUP_USER,ROLE_ADMIN,SENSITIVE_VARIABLES_OBSERVER,SERVICE_CONNECTION_ADMIN,SESSION_VARIABLES_ADMIN,SET_USER_ID,SHOW_ROUTINE,SYSTEM_USER,SYSTEM_VARIABLES_ADMIN,TABLE_ENCRYPTION_ADMIN,TELEMETRY_LOG_ADMIN,XA_RECOVER_ADMIN ON *.* TO `a`@`%` |
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
2 rows in set (0.00 sec)

10.将角色a授权给账号aaa

mysql> grant a to aaa;
Query OK, 0 rows affected (0.00 sec)mysql> show grants for aaa;
+---------------------------------+
| Grants for aaa@%                |
+---------------------------------+
| GRANT USAGE ON *.* TO `aaa`@`%` |
| GRANT `a`@`%` TO `aaa`@`%`      |
+---------------------------------+
2 rows in set (0.00 sec)mysql> quit
Bye

11.远程登录查看库,发现角色不生效

12.角色不生效的处理

#在配置文件中添加activate_all_roles_on_login=on
[root@004 mysql]# vim /usr/local/mysql/my.cnf 
[mysqld]
basedir=/usr/local/mysql
datadir=/usr/local/mysql/data
socket=/tmp/mysql.sock
activate_all_roles_on_login=on

glibc安装,my.cnf在项目目录之下;

rpm安装,my.cnf文件在/etc/my.cnf下;

13.远程登录工具刷新,就能看到库了

二、主从数据库

1.环境准备

准备两台机器

编号主机名主机IP
1master192.168.2.38
2slave192.168.2.39

主服务器配置

(1)关闭防火墙

[root@master ~]# systemctl stop firewalld
[root@master ~]# systemctl disable firewalld
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.

(2)关闭selinux

[root@master ~]# setenforce 0
[root@master ~]# vim /etc/selinux/config 

(3)安装ntpdate

[root@master ~]# yum -y install ntpdate.x86_64 

(4)同步时间

[root@master ~]# ntpdate cn.ntp.org.cn6 Aug 11:40:58 ntpdate[1764]: adjust time server 203.107.6.88 offset 0.012037 sec

从服务器配置

(1)关闭防火墙

[root@slave ~]# systemctl stop firewalld
[root@slave ~]# systemctl disable firewalld
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.

(2)关闭selinux

[root@slave ~]# setenforce 0
[root@slave ~]# vim /etc/selinux/config 

(3)安装ntpdate

[root@slave ~]# yum -y install ntpdate.x86_64 

(4)同步时间

[root@slave ~]# ntpdate cn.ntp.org.cn6 Aug 11:39:58 ntpdate[1851]: adjust time server 182.92.12.11 offset 0.012761 sec

2.安装mysql

(1)主数据库

写mysql.sh脚本,安装mysql

[root@master ~]# tar -xvf mysql-8.0.33-linux-glibc2.12-x86_64.tar

[root@master ~]# vim mysql.sh

# !/bin/bashyum list installed |grep libaio
if [ $? ne 0 ]; thenyum -y install libaio
fi
echo libaio yes
rm -rf /etc/my.cnf
echo remo my.cnf yestar -xf mysql-8.0.33-linux-glibc2.12-x86_64.tar.xz
echo tar zx yescp -r ~/mysql-8.0.33-linux-glibc2.12-x86_64 /usr/local/mysql
echo copy file to /usr/local/mysql   yesmkdir /usr/local/mysql/mysql-files
echo mysql-files yesgrep mysql /etc/passwduseradd -r -s /sbin/nologin mysqlchown mysql:mysql /usr/local/mysql/mysql-files
chmod 750 /usr/local/mysql/mysql-files/usr/local/mysql/bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql//usr/local/mysql/bin/mysql_ssl_rsa_setup --datadir=/usr/local/mysql/datacp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysql8sed -i '$aexport PATH=/usr/local/mysql/bin:$PATH' /etc/profile
source /etc/profile

运行脚本

[root@master ~]# source mysql.sh 

启动服务

[root@master ~]# service mysql8 start

给root修改密码

mysql> alter user 'root'@'localhost' identified by 'Hui@2003';

修改配置文件

[root@master ~]# vim /usr/local/mysql/my.cnf

[mysqld]
basedir=/usr/local/mysql
datadir=/usr/local/mysql/data
socket=/tmp/mysql.sock
port=3306
log-error=/usr/local/mysql/data/db01-master.err
log-bin=/usr/local/mysql/data/binlog
server-id=10
character_set_server=utf8mb4

开机自启:

[root@master ~]#chkconfig --add mysql8[root@master ~]#chkconfig mysql8 on[root@master ~]#chkconfig --list

(2)从数据库

[root@slave ~]# tar -xvf mysql-8.0.33-linux-glibc2.12-x86_64.tar 

用脚本安装mysql

[root@slave ~]# vim mysql.sh
# !/bin/bashyum list installed |grep libaio
if [ $? ne 0 ]; thenyum -y install libaio
fi
echo libaio yes
rm -rf /etc/my.cnf
echo remo my.cnf yestar -xf mysql-8.0.33-linux-glibc2.12-x86_64.tar.xz
echo tar zx yescp -r ~/mysql-8.0.33-linux-glibc2.12-x86_64 /usr/local/mysql
echo copy file to /usr/local/mysql   yesmkdir /usr/local/mysql/mysql-files
echo mysql-files yesgrep mysql /etc/passwduseradd -r -s /sbin/nologin mysqlchown mysql:mysql /usr/local/mysql/mysql-files
chmod 750 /usr/local/mysql/mysql-files# /usr/local/mysql/bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql/# /usr/local/mysql/bin/mysql_ssl_rsa_setup --datadir=/usr/local/mysql/datacp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysql8sed -i '$aexport PATH=/usr/local/mysql/bin:$PATH' /etc/profile
source /etc/profile

运行脚本

[root@slave ~]# source mysql.sh

修改配置文件

[root@slave ~]# vim /usr/local/mysql/my.cnf

[mysqld]
basedir=/usr/local/mysql
datadir=/usr/local/mysql/data
socket=/tmp/mysql.sock
port=3310
log-error=/usr/local/mysql/data/db01-slave.err
relay-log=/usr/local/mysql/data/relaylog
server-id=11
character_set_server=utf8mb4

3.删除/usr/local/mysql/data中的auto.cnf

主服务器:

#停止服务
[root@master ~]# service mysql8 stop
Shutting down MySQL.. SUCCESS! 
#查看ls /usr/local/mysql/data
[root@master ~]# ls /usr/local/mysql/data
auto.cnf       client-cert.pem    ibdata1       mysql.ibd           server-key.pem
binlog.000001  client-key.pem     #innodb_redo  performance_schema  sys
binlog.index   #ib_16384_0.dblwr  #innodb_temp  private_key.pem     undo_001
ca-key.pem     #ib_16384_1.dblwr  master.err    public_key.pem      undo_002
ca.pem         ib_buffer_pool     mysql         server-cert.pem
#删除/usr/local/mysql/data中的auto.cnf  
[root@master ~]# rm -rf /usr/local/mysql/data/auto.cnf 
[root@master ~]# yum -y install rsync

4.配置从数据库

#安装rsync
[root@slave ~]# yum -y install rsync

5.进行同步

#将主的/usr/local/mysql/data文件同步到从服务器中
[root@master ~]# rsync -av /usr/local/mysql/data root@192.168.2.39:/usr/local/mysql/#去从服务器上,就发现将data同步过来了
[root@slave ~]# ls /usr/local/mysql/data/
binlog.000001    client-key.pem     #innodb_redo  performance_schema  sys
binlog.index     #ib_16384_0.dblwr  #innodb_temp  private_key.pem     undo_001
ca-key.pem       #ib_16384_1.dblwr  master.err    public_key.pem      undo_002
ca.pem           ib_buffer_pool     mysql         server-cert.pem
client-cert.pem  ibdata1            mysql.ibd     server-key.pem

6.在主数据库中创建账号

[root@master ~]# service mysql8 start
Starting MySQL.Logging to '/usr/local/mysql/data/db01-master.err'.
. SUCCESS! #在主服务器里创建用户[root@master ~]# mysql -P3306 -p'Hui@2003' 
mysql> create user 'hui'@'%' identified by 'Hui@2003';#给权限mysql> grant replication slave on * .* to 'hui'@'%';#锁表mysql> flush tables with read lock;
Query OK, 0 rows affected (0.00 sec)#因为锁表,所以创建不了mysql> create database if not exists abc charset utf8;
ERROR 1223 (HY000): Can't execute the query because you have a conflicting read lock#查看二进制文件mysql> show master status;
+---------------+----------+--------------+------------------+-------------------+
| File          | Position | Binlog_Do_DB | Binlog_Ignore_DB | Executed_Gtid_Set |
+---------------+----------+--------------+------------------+-------------------+
| binlog.000002 |     1074 |              |                  |                   |
+---------------+----------+--------------+------------------+-------------------+
1 row in set (0.01 sec)

7.查看从数据库的server_id

#从的server-id不能和主的一样[root@slave ~]# mysql -pHui@2003mysql> show variables like 'server_id';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| server_id     | 11    |
+---------------+-------+
1 row in set (0.02 sec)

8.获得远程主机master主机的公钥

[root@slave ~]# mysql -uhui -p'Hui@2003' -h192.168.2.38 -P3306 --get-server-public-keymysql> quit
Bye

9.登录本地的slave服务器数据库

[root@slave ~]# mysql -P3310 -pHui@2003mysql> change master to-> master_host='192.168.2.38',-> master_user='hui',-> master_port=3306,-> master_log_file='binlog.000002',-> master_log_pos=1074;
Query OK, 0 rows affected, 8 warnings (0.02 sec)

10.启动slave服务

mysql> start slave;
Query OK, 0 rows affected, 1 warning (0.02 sec)

11.查看从服务器的状态信息

mysql> show slave status\G

三、测试

#因为锁表,所以创建不了
mysql> create database if not exists test charset utf8mb4;
ERROR 1223 (HY000): Can't execute the query because you have a conflicting read lock#解锁
mysql> unlock tables;
Query OK, 0 rows affected (0.00 sec)#可以创建表了
mysql> create database if not exists test charset utf8mb4;
Query OK, 1 row affected (0.00 sec)#使用数据库
mysql> use test;
Database changed#创建表
mysql> create table user(id int primary key,username varchar(45) not null,password varchar(45) not null);
Query OK, 0 rows affected (0.03 sec)#插入数据
mysql> insert into user values(1,'zhangsan','abc');
Query OK, 1 row affected (0.02 sec)#查看
mysql> select * from user;
+----+----------+----------+
| id | username | password |
+----+----------+----------+
|  1 | zhangsan | abc      |
+----+----------+----------+
1 row in set (0.01 sec)#查看数据库
mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
| test               |
+--------------------+
5 rows in set (0.00 sec)

从数据库就会同步

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

如若内容造成侵权/违法违规/事实不符,请联系长河编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

【C语言】位段详解

🦄个人主页:小米里的大麦-CSDN博客 🎏所属专栏:https://blog.csdn.net/huangcancan666/category_12718530.html 🎁代码托管:黄灿灿 (huang-cancan-xbc) - Gitee.com ⚙️操作环境:Visual Studio 2022 目录 一、什么是位段? 二、…

Leetcode面试经典150题-2.两数相加

解法都在代码里,不懂就留言或者私信 /*** Definition for singly-linked list.* public class ListNode {* int val;* ListNode next;* ListNode() {}* ListNode(int val) { this.val val; }* ListNode(int val, ListNode next) { this.val …

ubuntu插入模块测试

文章目录 一、环境二、步骤 一、环境 ubuntu 20.04 内核版本:5.15-generic 二、步骤 先看一下ubuntu用的哪个内核版本: 到内核目录下: 随便建个文件夹存一下编译完的ko模块: 写测试代码: 写makefile:…

Flink-DataWorks第六部分:数据运维(第62天)

系列文章目录 运维中心 4.1 功能概述 4.2 操作流程 4.2.1 操作流程概览 4.2.2 步骤一:查看周期任务配置 4.2.3 步骤二:测试周期任务 4.2.4 步骤三:周期任务补历史数据 4.2.5 步骤四:查看周期实例 4.2.6 步骤五:查看执…

knn图像分类

K近邻算法(K-NN),即给定一个已训练的数据集,对新的输入实例,在训练数据集中找到与该实例最邻近的K个实例,这K个实例的多数属于某个类,则判定该输入实例同属此类。 1. OpenCV K近邻模块的使用 接下来通过一个例子&…

掌握 Nuxt 3 的页面元数据:使用 definePageMeta 进行自定义配置

title: 掌握 Nuxt 3 的页面元数据:使用 definePageMeta 进行自定义配置 date: 2024/8/11 updated: 2024/8/11 author: cmdragon excerpt: 摘要:本文详细介绍Nuxt 3框架中definePageMeta的使用方法,包括如何为页面组件定义元数据&#xff0…

集合的框架(之一)

集合的含义: 集合是一个可变的容器,可以随时向集合中添加元素,也可以随时从集合中删除元素。另外,集合还提供了若干个用来操作集合中数据的方法。集合里的数据,我们称之为元素(elements);集合只能用来存储…

2025年美国数学竞赛AMC8暑期备考:吃透625道真题和知识点(持续)

距离接下来最近的2025年AMC8美国数学竞赛还有几个月的时间,实践证明,做真题,吃透真题和背后的知识点是备考AMC8有效的方法之一。 通过做真题,可以帮助孩子找到真实竞赛的感觉,而且更加贴近比赛的内容,可以…

1915_开源C语言实现的通用队列

经常在工作中遇到一些队列处理的场景,以前要么是借用FreeRTOS这样的系统中的相关功能,要么是通过数组做一个简单的队列模型。但是,这两种方案都具有一定的局限性能,前者要求的FreeRTOS不见得相应的软件中有,而后者只能…

超好玩的肉鸽游戏:《暴君的游戏》手机单机游戏分享

《暴君的游戏》(Despots Game)是一款结合了自走棋和roguelike元素的像素策略冒险游戏。游戏以其独特的战斗系统和丰富的职业选择,为玩家提供了深度的策略体验和探索乐趣。 游戏特色包括: 角色职业多样性:玩家可以招募…

使用历史版本比对法排查C++程序中的内存泄漏问题

目录 1、问题描述 2、使用Process Explorer实时查看程序的虚拟内存占用 2.1、对于内存泄漏问题,需要查看程序占用的虚拟内存 2.2、Windows任务管理器中看不到程序进程占用的虚拟内存,使用Process Explorer工具可以看到 2.3、通过Process Explorer工具看到每次泄漏的内存…

大数据-75 Kafka 高级特性 稳定性-一致性保证 LogAndOffset(LEO) HightWatermark(HW) 水位/水印

点一下关注吧!!!非常感谢!!持续更新!!! 目前已经更新到了: Hadoop(已更完)HDFS(已更完)MapReduce(已更完&am…

LVS实战项目

LVS简介 LVS:Linux Virtual Server,负载调度器,内核集成,章文嵩,阿里的四层SLB(Server LoadBalance)是基于LVSkeepalived实现。 LVS集群的类型 lvs-nat : 修改请求报文的目标IP, 多目标 IP 的 DNAT lvs-dr &#xff…

本科阶段最后一次竞赛Vlog——2024年智能车大赛智慧医疗组准备全过程——6Resnet实现黑线识别

本科阶段最后一次竞赛Vlog——2024年智能车大赛智慧医疗组准备全过程——6Resnet实现黑线识别 ​ 比赛还有重要部分就是黑线的识别,这块地平线社区的帖子很多 ​ 在本次我就使用了社区吴超大佬写出的文章,当然我们的步骤有所不同,也是比较省…

黄牛杀手 抢票脚本 V3.0

黄牛杀手 抢票脚本 V3.0 介绍 现在黄牛太tm多了,根本抢不到票 为了解决这个问题,开发了这个脚本,支持大麦网,淘票票、缤玩岛等多个平台 依赖 selenium (4.10.0以下版本) pip install selenium 现在黄牛太tm多了,根…

2.类和对象(上)

1. 类的定义 1.1 类定义格式 • class为定义类的关键字,Stack为类的名字,{ }中为类的主体,注意类定义结束时后面分号不能省略。类体中内容称为类的成员:类中的变量称为类的属性或成员变量; (类和结构体非常像&#…

LVS原理——详细介绍

目录 lvs简介 LVS作用 LVS 的优势与不足 LVS概念与相关术语 LVS的3种工作模式 LVS调度算法 LVS-dr模式 LVS-tun模式 ipvsadm工具使用 lvs简介 LVS 是Linux Virtual Server的简称,也就是 Linux 虚拟服务器,是一个极好的负载均衡解决方案,它将一个…

计数排序,桶排序,基数排序

计数排序: 找出数据中的最大值和最小值,并创建哈希表,把 数据-最小值 作为数组的下标访问哈希表并标记数量,标记完后,遍历哈希表,当表中的值大于0,把 **下标最小值 (下标元素-最小值)**还原数据…

LLVM 寄存器分配

概述 基本寄存器分配器是四种寄存器分配器中最简单的寄存器分配pass实现(<llvm_root/livm/lib/CodeGen/RegAllocBasic.cpp>) 但麻雀虽小&#xff0c;五脏俱全&#xff0c;基本寄存器分配器中实现了根据溢出权重确实虚拟寄存器优先级、按优先级分配物理寄存器&#xff0…

韦东山瑞士军刀项目自学之UART

放自己一星期假回家&#xff0c;回来继续准备秋招。 本章记录关于UART协议的相关知识笔记。平时主要还是基于HAL库开发&#xff0c;但笔记里也讲了韦老师介绍的如何控制寄存器来设置UART的参数。 以及一些UART防止采集的抖动设置的一些策略与波特率与比特率的区别等。