当前位置: 首页 > news >正文

自己做的网站被黑了怎么办/搜索引擎营销的模式有哪些

自己做的网站被黑了怎么办,搜索引擎营销的模式有哪些,做网站联盟,seo高级优化技巧Python MySQL - mysql-connector 驱动 MySQL 是最流行的关系型数据库管理系统,如果你不熟悉 MySQL,可以阅读我们的 MySQL 教程。 本章节我们为大家介绍使用 mysql-connector 来连接使用 MySQL, mysql-connector 是 MySQL 官方提供的驱动器。…

Python MySQL - mysql-connector 驱动

MySQL 是最流行的关系型数据库管理系统,如果你不熟悉 MySQL,可以阅读我们的 MySQL 教程。
本章节我们为大家介绍使用 mysql-connector 来连接使用 MySQL, mysql-connector 是 MySQL 官方提供的驱动器。

我们可以使用 pip 命令来安装 mysql-connector:

python -m pip install mysql-connector

使用以下代码测试 mysql-connector 是否安装成功:

demo_mysql_test.py:

import mysql.connector

执行以上代码,如果没有产生错误,表明安装成功。
注意:如果你的 MySQL 是 8.0 版本,密码插件验证方式发生了变化,早期版本为 mysql_native_password,8.0 版本为 caching_sha2_password,所以需要做些改变:

先修改 my.ini 配置:

[mysqld]
default_authentication_plugin=mysql_native_password

然后在 mysql 下执行以下命令来修改密码:

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '新密码';

更多内容可以参考:Python MySQL8.0 链接问题。


创建数据库连接

可以使用以下代码来连接数据库:
demo_mysql_test.py:

import mysql.connector
mydb = mysql.connector.connect(host="localhost",       # 数据库主机地址user="yourusername",    # 数据库用户名passwd="yourpassword"   # 数据库密码
)
print(mydb)

创建数据库
创建数据库使用 “CREATE DATABASE” 语句,以下创建一个名为 runoob_db 的数据库:

demo_mysql_test.py:

import mysql.connector
mydb = mysql.connector.connect(host="localhost",user="root",passwd="123456"
)
mycursor = mydb.cursor()
mycursor.execute("CREATE DATABASE runoob_db")

创建数据库前我们也可以使用 “SHOW DATABASES” 语句来查看数据库是否存在:
demo_mysql_test.py:
输出所有数据库列表:

import mysql.connectormydb = mysql.connector.connect(host="localhost",user="root",passwd="123456"
)
mycursor = mydb.cursor()
mycursor.execute("SHOW DATABASES")
for x in mycursor:print(x)

或者我们可以直接连接数据库,如果数据库不存在,会输出错误信息:
demo_mysql_test.py:

import mysql.connector
mydb = mysql.connector.connect(host="localhost",user="root",passwd="123456",database="runoob_db"
)

创建数据表

创建数据表使用 “CREATE TABLE” 语句,创建数据表前,需要确保数据库已存在,以下创建一个名为 sites 的数据表:

demo_mysql_test.py:
import mysql.connectormydb = mysql.connector.connect(host="localhost",user="root",passwd="123456",database="runoob_db"
)
mycursor = mydb.cursor()
mycursor.execute("CREATE TABLE sites (name VARCHAR(255), url VARCHAR(255))")

执行成功后,我们可以看到数据库创建的数据表 sites,字段为 name 和 url。
在这里插入图片描述

我们也可以使用 “SHOW TABLES” 语句来查看数据表是否已存在:
demo_mysql_test.py:

import mysql.connector 
mydb = mysql.connector.connect(host="localhost",user="root",passwd="123456",database="runoob_db"
)
mycursor = mydb.cursor()
mycursor.execute("SHOW TABLES")
for x in mycursor:print(x)

主键设置
创建表的时候我们一般都会设置一个主键(PRIMARY KEY),我们可以使用 “INT AUTO_INCREMENT PRIMARY KEY” 语句来创建一个主键,主键起始值为 1,逐步递增。
如果我们的表已经创建,我们需要使用 ALTER TABLE 来给表添加主键:
demo_mysql_test.py:
给 sites 表添加主键。

import mysql.connector
mydb = mysql.connector.connect(host="localhost",user="root",passwd="123456",database="runoob_db"
)
mycursor = mydb.cursor()
mycursor.execute("ALTER TABLE sites ADD COLUMN id INT AUTO_INCREMENT PRIMARY KEY")

如果你还未创建 sites 表,可以直接使用以下代码创建。
demo_mysql_test.py:
给表创建主键。

import mysql.connector
mydb = mysql.connector.connect(host="localhost",user="root",passwd="123456",database="runoob_db"
)
mycursor = mydb.cursor()
mycursor.execute("CREATE TABLE sites (id INT AUTO_INCREMENT PRIMARY KEY, name VARCHAR(255), url VARCHAR(255))")

插入数据

插入数据使用 “INSERT INTO” 语句:
demo_mysql_test.py:
向 sites 表插入一条记录。

import mysql.connector
mydb = mysql.connector.connect(host="localhost",user="root",passwd="123456",database="runoob_db"
)
mycursor = mydb.cursor()
sql = "INSERT INTO sites (name, url) VALUES (%s, %s)"
val = ("RUNOOB", "https://www.runoob.com")
mycursor.execute(sql, val)
mydb.commit()    # 数据表内容有更新,必须使用到该语句
print(mycursor.rowcount, "记录插入成功。")

执行代码,输出结果为:

1 记录插入成功

批量插入
批量插入使用 executemany() 方法,该方法的第二个参数是一个元组列表,包含了我们要插入的数据:
demo_mysql_test.py:
向 sites 表插入多条记录。

import mysql.connector
mydb = mysql.connector.connect(host="localhost",user="root",passwd="123456",database="runoob_db"
)
mycursor = mydb.cursor()
sql = "INSERT INTO sites (name, url) VALUES (%s, %s)"
val = [('Google', 'https://www.google.com'),('Github', 'https://www.github.com'),('Taobao', 'https://www.taobao.com'),('stackoverflow', 'https://www.stackoverflow.com/')
]
mycursor.executemany(sql, val)
mydb.commit()    # 数据表内容有更新,必须使用到该语句
print(mycursor.rowcount, "记录插入成功。")

执行代码,输出结果为:

4 记录插入成功。

执行以上代码后,我们可以看看数据表的记录:
在这里插入图片描述

如果我们想在数据记录插入后,获取该记录的 ID ,可以使用以下代码:
demo_mysql_test.py:

import mysql.connector
mydb = mysql.connector.connect(host="localhost",user="root",passwd="123456",database="runoob_db"
)
mycursor = mydb.cursor()
sql = "INSERT INTO sites (name, url) VALUES (%s, %s)"
val = ("Zhihu", "https://www.zhihu.com")
mycursor.execute(sql, val)
mydb.commit()
print("1 条记录已插入, ID:", mycursor.lastrowid)

执行代码,输出结果为:

1 条记录已插入, ID: 6

查询数据

查询数据使用 SELECT 语句:
demo_mysql_test.py:

import mysql.connector
mydb = mysql.connector.connect(host="localhost",user="root",passwd="123456",database="runoob_db"
)
mycursor = mydb.cursor()
mycursor.execute("SELECT * FROM sites")
myresult = mycursor.fetchall()     # fetchall() 获取所有记录
for x in myresult:print(x)

执行代码,输出结果为:

(1, 'RUNOOB', 'https://www.runoob.com')
(2, 'Google', 'https://www.google.com')
(3, 'Github', 'https://www.github.com')
(4, 'Taobao', 'https://www.taobao.com')
(5, 'stackoverflow', 'https://www.stackoverflow.com/')
(6, 'Zhihu', 'https://www.zhihu.com')

也可以读取指定的字段数据:

demo_mysql_test.py:

import mysql.connector
mydb = mysql.connector.connect(host="localhost",user="root",passwd="123456",database="runoob_db"
)
mycursor = mydb.cursor()
mycursor.execute("SELECT name, url FROM sites")
myresult = mycursor.fetchall()
for x in myresult:print(x)

执行代码,输出结果为:

('RUNOOB', 'https://www.runoob.com')
('Google', 'https://www.google.com')
('Github', 'https://www.github.com')
('Taobao', 'https://www.taobao.com')
('stackoverflow', 'https://www.stackoverflow.com/')
('Zhihu', 'https://www.zhihu.com')

如果我们只想读取一条数据,可以使用 fetchone() 方法:
demo_mysql_test.py:

import mysql.connector
mydb = mysql.connector.connect(host="localhost",user="root",passwd="123456",database="runoob_db"
)
mycursor = mydb.cursor()
mycursor.execute("SELECT * FROM sites")
myresult = mycursor.fetchone()
print(myresult)

执行代码,输出结果为:

(1, 'RUNOOB', 'https://www.runoob.com')

where 条件语句
如果我们要读取指定条件的数据,可以使用 where 语句:
demo_mysql_test.py
读取 name 字段为 RUNOOB 的记录:

import mysql.connector
mydb = mysql.connector.connect(host="localhost",user="root",passwd="123456",database="runoob_db"
)
mycursor = mydb.cursor()
sql = "SELECT * FROM sites WHERE name ='RUNOOB'"
mycursor.execute(sql)
myresult = mycursor.fetchall()
for x in myresult:print(x)

执行代码,输出结果为:

(1, 'RUNOOB', 'https://www.runoob.com')

也可以使用通配符 %:
demo_mysql_test.py

import mysql.connector
mydb = mysql.connector.connect(host="localhost",user="root",passwd="123456",database="runoob_db"
)
mycursor = mydb.cursor()
sql = "SELECT * FROM sites WHERE url LIKE '%oo%'"
mycursor.execute(sql)
myresult = mycursor.fetchall()
for x in myresult:print(x)

执行代码,输出结果为:

(1, 'RUNOOB', 'https://www.runoob.com')
(2, 'Google', 'https://www.google.com')

为了防止数据库查询发生 SQL 注入的攻击,我们可以使用 %s 占位符来转义查询的条件:
demo_mysql_test.py

import mysql.connector
mydb = mysql.connector.connect(host="localhost",user="root",passwd="123456",database="runoob_db"
)
mycursor = mydb.cursor()
sql = "SELECT * FROM sites WHERE name = %s"
na = ("RUNOOB", )
mycursor.execute(sql, na)
myresult = mycursor.fetchall()
for x in myresult:print(x)

排序
查询结果排序可以使用 ORDER BY 语句,默认的排序方式为升序,关键字为 ASC,如果要设置降序排序,可以设置关键字 DESC。
demo_mysql_test.py
按 name 字段字母的升序排序:

import mysql.connector
mydb = mysql.connector.connect(host="localhost",user="root",passwd="123456",database="runoob_db"
)
mycursor = mydb.cursor()
sql = "SELECT * FROM sites ORDER BY name"
mycursor.execute(sql)
myresult = mycursor.fetchall()
for x in myresult:print(x)

执行代码,输出结果为:

(3, 'Github', 'https://www.github.com')
(2, 'Google', 'https://www.google.com')
(1, 'RUNOOB', 'https://www.runoob.com')
(5, 'stackoverflow', 'https://www.stackoverflow.com/')
(4, 'Taobao', 'https://www.taobao.com')
(6, 'Zhihu', 'https://www.zhihu.com')

降序排序实例:

demo_mysql_test.py
按 name 字段字母的降序排序:

import mysql.connectormydb = mysql.connector.connect(host="localhost",user="root",passwd="123456",database="runoob_db"
)
mycursor = mydb.cursor()
sql = "SELECT * FROM sites ORDER BY name DESC"
mycursor.execute(sql)
myresult = mycursor.fetchall()
for x in myresult:print(x)

执行代码,输出结果为:

(6, 'Zhihu', 'https://www.zhihu.com')
(4, 'Taobao', 'https://www.taobao.com')
(5, 'stackoverflow', 'https://www.stackoverflow.com/')
(1, 'RUNOOB', 'https://www.runoob.com')
(2, 'Google', 'https://www.google.com')
(3, 'Github', 'https://www.github.com')

Limit
如果我们要设置查询的数据量,可以通过 “LIMIT” 语句来指定
demo_mysql_test.py
读取前 3 条记录:

import mysql.connector
mydb = mysql.connector.connect(host="localhost",user="root",passwd="123456",database="runoob_db"
)
mycursor = mydb.cursor()
mycursor.execute("SELECT * FROM sites LIMIT 3")
myresult = mycursor.fetchall()
for x in myresult:print(x)

执行代码,输出结果为:

(1, 'RUNOOB', 'https://www.runoob.com')
(2, 'Google', 'https://www.google.com')
(3, 'Github', 'https://www.github.com')

也可以指定起始位置,使用的关键字是 OFFSET:
demo_mysql_test.py
从第二条开始读取前 3 条记录:

import mysql.connector
mydb = mysql.connector.connect(host="localhost",user="root",passwd="123456",database="runoob_db"
)
mycursor = mydb.cursor()
mycursor.execute("SELECT * FROM sites LIMIT 3 OFFSET 1")  # 0 为 第一条,1 为第二条,以此类推
myresult = mycursor.fetchall()
for x in myresult:print(x)

执行代码,输出结果为:

(2, 'Google', 'https://www.google.com')
(3, 'Github', 'https://www.github.com')
(4, 'Taobao', 'https://www.taobao.com')

删除记录

删除记录使用 “DELETE FROM” 语句:
demo_mysql_test.py
删除 name 为 stackoverflow 的记录:

import mysql.connector
mydb = mysql.connector.connect(host="localhost",user="root",passwd="123456",database="runoob_db"
)
mycursor = mydb.cursor()
sql = "DELETE FROM sites WHERE name = 'stackoverflow'"
mycursor.execute(sql)
mydb.commit()
print(mycursor.rowcount, " 条记录删除")

执行代码,输出结果为:

1  条记录删除

注意:要慎重使用删除语句,删除语句要确保指定了 WHERE 条件语句,否则会导致整表数据被删除。
为了防止数据库查询发生 SQL 注入的攻击,我们可以使用 %s 占位符来转义删除语句的条件:
demo_mysql_test.py

import mysql.connector
mydb = mysql.connector.connect(host="localhost",user="root",passwd="123456",database="runoob_db"
)
mycursor = mydb.cursor()
sql = "DELETE FROM sites WHERE name = %s"
na = ("stackoverflow", )
mycursor.execute(sql, na)
mydb.commit()
print(mycursor.rowcount, " 条记录删除")

执行代码,输出结果为:

1  条记录删除

更新表数据

数据表更新使用 “UPDATE” 语句:
demo_mysql_test.py
将 name 为 Zhihu 的字段数据改为 ZH:

import mysql.connector
mydb = mysql.connector.connect(host="localhost",user="root",passwd="123456",database="runoob_db"
)
mycursor = mydb.cursor()
sql = "UPDATE sites SET name = 'ZH' WHERE name = 'Zhihu'"
mycursor.execute(sql)
mydb.commit()
print(mycursor.rowcount, " 条记录被修改")

执行代码,输出结果为:

1  条记录被修改

注意:UPDATE 语句要确保指定了 WHERE 条件语句,否则会导致整表数据被更新。
为了防止数据库查询发生 SQL 注入的攻击,我们可以使用 %s 占位符来转义更新语句的条件:
demo_mysql_test.py

import mysql.connector
mydb = mysql.connector.connect(host="localhost",user="root",passwd="123456",database="runoob_db"
)
mycursor = mydb.cursor()
sql = "UPDATE sites SET name = %s WHERE name = %s"
val = ("Zhihu", "ZH")
mycursor.execute(sql, val)
mydb.commit()
print(mycursor.rowcount, " 条记录被修改")

执行代码,输出结果为:

1  条记录被修改

删除表
删除表使用 “DROP TABLE” 语句, IF EXISTS 关键字是用于判断表是否存在,只有在存在的情况才删除:
demo_mysql_test.py

import mysql.connector
mydb = mysql.connector.connect(host="localhost",user="root",passwd="123456",database="runoob_db"
)
mycursor = mydb.cursor()
sql = "DROP TABLE IF EXISTS sites"  # 删除数据表 sites
mycursor.execute(sql)

相关文章:

Python 3 教程第33篇(MySQL - mysql-connector 驱动)

Python MySQL - mysql-connector 驱动 MySQL 是最流行的关系型数据库管理系统,如果你不熟悉 MySQL,可以阅读我们的 MySQL 教程。 本章节我们为大家介绍使用 mysql-connector 来连接使用 MySQL, mysql-connector 是 MySQL 官方提供的驱动器。…...

23种设计模式之外观模式

目录 1. 简介2. 代码2.1 SelectFoodService (选择食品)2.2 PayService (支付服务)2.3 TakeService (制作服务)2.4 OrderService (下单服务)2.5 Food (食品)2.6 TackingSystem (外观类)2.7 Test (测试类) 3. 优缺点3. 总结 1. 简介…...

GateWay使用手册

好的&#xff0c;下面是优化后的版本。为了提高可读性和规范性&#xff0c;我对内容进行了结构化、简化了部分代码&#xff0c;同时增加了注释说明&#xff0c;便于理解。 1. 引入依赖 在 pom.xml 中添加以下依赖&#xff1a; <dependencies><!-- Spring Cloud Gate…...

MySQL1.0

1.数据库的三大范式 范式是为了使数据库设计更加合理&#xff0c;规范&#xff0c;减少数据冗余和数据不一致等问题指定的一系列规则。 第一范式&#xff1a;第一范式要求数据表中的每一列都是不可分割的原子数据项。例如&#xff1a;有一个学生信息表&#xff0c;包含 “学生…...

IDEA使用HotSwapHelper进行热部署

目录 前言JDK1.8特殊准备DECVM安装插件安装与配置参考文档相关下载 前言 碰到了一个项目&#xff0c;用jrebel启动项目时一直报错&#xff0c;不用jrebel时又没问题&#xff0c;找不到原因&#xff0c;又不想放弃热部署功能 因此思考能否通过其他方式进行热部署&#xff0c;找…...

简单web项目自定义部署Dockerfile

本意就是弄清楚如何做web自定义项目的镜像。 基础镜像是java:8u261-jdk&#xff0c;其中java路径为/opt/java webdemo1.0.0.1-SNAPSHOT.jar文件里面已经包含了lib文件。 可以设置PATH也可以不设置&#xff0c;但是建议设置JAVA_HOME FROM swr.cn-north-4.myhuaweicloud.com…...

基础Web安全|SQL注入

基础Web安全 URI Uniform Resource Identifier&#xff0c;统一资源标识符&#xff0c;用来唯一的标识一个资源。 URL Uniform Resource Locator&#xff0c;统一资源定位器&#xff0c;一种具体的URI&#xff0c;可以标识一个资源&#xff0c;并且指明了如何定位这个资源…...

SpringBoot -拦截器Interceptor、过滤器 Filter 及设置

Spring Boot拦截器&#xff08;Interceptor&#xff09;的概念 - 在Spring Boot中&#xff0c;拦截器是一种AOP的实现方式。它主要用于<font style"color:#DF2A3F;">拦截请求</font>&#xff0c;在请求处理之前和之后执行特定的代码逻辑。与过滤器不同的…...

C++小问题

怎么分辨const修饰的是谁 是限定谁不能被改变的&#xff1f; 在C中&#xff0c;const关键字的用途和位置非常关键&#xff0c;它决定了谁不能被修改。const可以修饰变量、指针、引用等不同的对象&#xff0c;并且具体的作用取决于const的修饰位置。理解const的规则能够帮助我们…...

avcodec_alloc_context3,avcodec_open2,avcodec_free_context,avcodec_close

avcodec_alloc_context3 是创建编解码器上下文&#xff0c;需要使用 avcodec_free_context释放 需要使用avcodec_free_context 释放 /** * Allocate an AVCodecContext and set its fields to default values. The * resulting struct should be freed with avcodec_free_co…...

强化学习的几个主要方法(策略梯度、PPO、REINFORCE实现等)(下)

由于平台字数限制&#xff0c;上文&#xff1a;https://blog.csdn.net/ooblack/article/details/144198538 4. PPO算法 近端策略优化&#xff08;proximal policy optimization&#xff0c;PPO&#xff09;算法是OpenAI的默认强化学习算法&#xff0c;在RLHF中也用到了这个算…...

计算机网络:IP协议详细讲解

目录 前言 一、IP网段划分 二、IP报头 三、解决IP地址不足-->NAT技术 前言 在之前&#xff0c;我们学习了传输层中的TCP和UDP&#xff0c;重点是TCP协议&#xff0c;他帮我们解决具体到主机的哪个应用&#xff08;端口&#xff09;、传输的可靠&#xff08;序列号、校验和…...

2024信创数据库TOP30之华为Gauss DB

近日&#xff0c;由DBC联合CIW/CIS共同发布的“2024信创数据库TOP30”榜单正式揭晓&#xff0c;汇聚了国内顶尖的数据库企业及其产品&#xff0c;成为展示中国信创领域技术实力与发展潜力的重要平台。在这份榜单中&#xff0c;华为的GaussDB凭借其卓越的技术实力、广泛的行业应…...

在线家具商城基于 SpringBoot:设计模式与实现方法探究

第3章 系统分析 用户的需求以及与本系统相似的在市场上存在的其它系统可以作为系统分析中参考的资料&#xff0c;分析人员可以根据这些信息确定出本系统具备的功能&#xff0c;分析出本系统具备的性能等内容。 3.1可行性分析 尽管系统是根据用户的要求进行制作&#xff0c;但是…...

九、Spring Boot集成Spring Security之授权概述

文章目录 往期回顾&#xff1a;Spring Boot集成Spring Security专栏及各章节快捷入口前言一、授权概述二、用户权限三、用户授权流程三、Spring Security授权方式1、请求级别授权2、方法级别授权 往期回顾&#xff1a;Spring Boot集成Spring Security专栏及各章节快捷入口 Spr…...

python之Flask入门—路由参数

语法&#xff1a; /routerName/<string:parameter_name> 其中&#xff1a;routerName代表路由名称<>中的string是参数类型&#xff0c;parameter_name为参数名称 参数类型&#xff1a; &#xff08;1&#xff09; string 接收任何没有斜杠&#xff08;/&#x…...

txt地图格式处理

1、txt地图格式 [属性描述] 坐标系2000国家大地坐标系 几度分带3 投影类型高斯克吕格 计量单位米 带号38 精度0.001 转换参数,,,,,, [地块坐标] 5,475.888,1,测试地块1,面,J50G077061,公路用地,地下, J1,1,113.22222222222222,23.129111721551794 J2,1,113.2722314…...

《数据挖掘:概念、模型、方法与算法(第三版)》

嘿&#xff0c;数据挖掘的小伙伴们&#xff01;今天我要给你们介绍一本超级实用的书——《数据挖掘&#xff1a;概念、模型、方法与算法》第三版。这本书是数据挖掘领域的经典之作&#xff0c;由该领域的知名专家编写&#xff0c;系统性地介绍了在高维数据空间中分析和提取大量…...

GitLab CVE-2024-8114 漏洞解决方案

漏洞 ID 标题严重等级CVE ID通过 LFS 令牌提升权限高CVE-2024-8114 GitLab 升级指南GitLab 升级路径查看版本漏洞查询 漏洞解读 此漏洞允许攻击者使用受害者的个人访问令牌&#xff08;PAT&#xff09;进行权限提升。影响从 8.12 开始到 17.4.5 之前的所有版本、从 17.5 开…...

request和websocket

当然&#xff0c;可以为你详细介绍 FastAPI 中的 Request 对象。Request 对象在 FastAPI 中扮演着重要的角色&#xff0c;负责封装来自客户端的 HTTP 请求信息。了解 Request 对象的使用方法和属性&#xff0c;有助于你更高效地处理请求数据、访问请求上下文以及进行各种操作。…...

一键生成后端服务,MemFire Cloud重新定义开发效率

作为开发者&#xff0c;特别是独立开发者和小团队成员&#xff0c;大家都知道开发的最大难题之一就是搭建后端服务。要让一个应用从零开始&#xff0c;除了前端的开发工作外&#xff0c;还需要考虑数据库、接口、认证、存储等等一系列繁琐的后台工作。而MemFire Cloud这款神器&…...

短视频矩阵的营销策略:批量混剪实现高效传播

在当今的商业环境中&#xff0c;短视频营销已成为企业获得市场份额的关键策略。随着消费者注意力的分散&#xff0c;传统营销方法的效果逐渐减弱。因此&#xff0c;短视频营销的重要性不言而喻。通过短视频&#xff0c;品牌能够以更为生动和直观的方式传递信息&#xff0c;从而…...

朗迪锋亮相2024人因工程与智能系统交互国际会议

2024年11月28日至30日&#xff0c;2024人因工程与智能系统交互国际会议在深圳隆重举办。此次大会以推动我国人因工程学科发展为目标&#xff0c;致力于加强国际学术交流&#xff0c;深入探讨人工智能时代的智能系统交互&#xff0c;旨在培育新质生产力&#xff0c;助力经济社会…...

spring boot3.3.5 logback-spring.xml 配置

新建 resources/logback-spring.xml 控制台输出颜色有点花 可以自己更改 <?xml version"1.0" encoding"UTF-8"?> <!--关闭文件扫描 scanfalse --> <configuration debug"false" scan"false"><springProperty …...

Proteus8.17下载安装教程

Proteus是一款嵌入式系统仿真开发软件&#xff0c;实现了从原理图设计、单片机编程、系统仿真到PCB设计&#xff0c;真正实现了从概念到产品的完整设计&#xff0c;其处理器模型支持8051、HC11、PIC10/12/16/18/24/30/DsPIC33、AVR、ARM、8086和MSP430等&#xff0c;能够帮助用…...

一次Kafka启动失败引出的问题

背景 Some time&#xff0c;有个现场童鞋说咱的Kafka实例有个broker一直crash&#xff0c;还截图给我看了&#xff0c;大致是Kafka启动加载topic分区日志文件的时候&#xff0c;然后就没了&#xff0c;连个WARN都没有。当然&#xff0c;光看这个截图咱啥都不知道&#xff0c;因…...

mysql 查询所有的触发器

SELECTTRIGGER_SCHEMA AS Database,TRIGGER_NAME AS Trigger,EVENT_OBJECT_TABLE AS Table,EVENT_MANIPULATION AS Event,ACTION_STATEMENT AS Statement FROMinformation_schema.TRIGGERS;创建触发器遇到报错&#xff1a; You do not have the SUPER privilege and binary lo…...

704. 二分查找 C++

文章目录 一、题目链接二、参考代码三、所思所悟 一、题目链接 链接: 704. 二分查找 二、参考代码 int search(const vector<int>& nums, int target) {int left 0; int right nums.size() - 1;//左闭右闭[]while (left < right){int mid (left right) / 2;…...

SpringCloud Seata集成分布式事务管理 事务保护 XA AT两种模式的区别

介绍 阿里巴巴的 Seata&#xff08;Service Aligned Transaction Alternative&#xff09;是一个开源的分布式事务解决方案&#xff0c;旨在解决微服务架构中跨服务、跨数据库的事务一致性问题。它可以帮助开发者管理分布式系统中的全局事务&#xff0c;确保在多个服务之间的事…...

node.js基础学习-querystring模块-查询字符串处理(三)

一、前言 querystring是 Node.js 中的一个内置模块&#xff0c;主要用于处理 URL 查询字符串。它提供了一些实用的方法来解析和格式化查询字符串&#xff0c;使得在处理 HTTP 请求中的查询参数等场景时非常方便。 还可以防止sql注入 二、解析查询字符串&#xff08;parse方法&a…...