官方文档 搬运 MAXMIND IP定位 mysql导入 简单使用

news2024/10/7 1:26:18

官方文档地址:

官方文档       

文件下载

1. 导入mysql可能报错

Error Code: 1290. The MySQL server is running with the --secure-file-priv option so it cannot execute this statement

查看配置

    SHOW GLOBAL VARIABLES LIKE '%secure%';

secure_file_priv 原来是NULL 依旧报错 

 mysql --help | grep my.cnf                                                            
  
/etc/my.cnf /etc/mysql/my.cnf /opt/homebrew/etc/my.cnf ~/.my.cnf

#修改配置
vim /opt/homebrew/etc/my.cnf

#追加或修改
secure-file-priv = "/"



#重启mysql
mysql.server restart

将 GeoIP2 和 GeoLite2 数据库导入 MySQL

在本页

  • 下载并提取数据库
    • 保持数据库更新
    • 提取 CSV 文件
  • 为网络数据创建表
  • 转换网络字段
  • 架构
    • 将数据加载到网络表中
    • 通过查询来测试我们的表
    • 对表格进行排序以便更快地进行搜索
    • 分解查询以加快搜索速度
  • 可选:创建位置数据表
    • 位置表架构
    • 将数据加载到位置表中
    • 查询我们的表格

本指南将向您展示如何将 GeoIP2 或 GeoLite2 数据库导入 MySQL,以便在您的服务器上轻松查询和操作它们。

导入 CSV 数据库包括下载数据库、提取数据库、创建表来保存数据以及为加快查询速度而对这些表进行索引。

下载并提取数据库

首先,请确保您已下载要导入的 GeoIP2 或 GeoLite2 数据库的最新版本。您可以 通过您的帐户门户下载数据库。CSV 格式的数据库以单个 zip 文件的形式提供。有关存档的 zip 结构和内容的详细信息,请参阅我们的 CSV 数据库文档。在本教程中,我们将使用 GeoIP2 City CSV 文件,但您可以获取有关 我们的任何 CSV 格式数据库的信息并相应地调整以下说明。

保持数据库更新

如果您要导入数据库以供持续使用,您将需要 自动下载和提取 CSV 文件的过程 ,以确保您的数据库始终是最新的。

提取 CSV 文件

下载数据库后,将 zip 文件解压到所需目录中。如果要导入 GeoIP2 City 数据库,您将获得许多文件。在本教程中,我们将使用以下文件:

  • GeoIP2-City-Blocks-IPv4.csv
  • GeoIP2-City-Blocks-IPv6.csv
  • GeoIP2-City-Locations-en.csv

如果您使用英语以外的语言,则可以Locations从 zip 存档中选择适当的文件。例如,如果您想将中文位置名称加载到 MySQL,则可以使用 GeoIP2-City-Locations-zh-CN.csv而不是GeoIP2-City-Locations-en.csv。我们关于 CSV 格式数据库的文档包括 GeoIP2 和 GeoLite2 数据库中当前包含的所有位置文件的列表。

为网络数据创建表

GeoIP2-City-Blocks-IPv4.csv首先我们创建一个表来保存和中包含的网络信息 GeoIP2-City-Blocks-IPv6.csv

转换网络字段

您可以在GeoIP2 和 GeoLite2 CSV 数据库文件部分Blocks中找到这些文件架构的完整描述 。如果您使用的是其他数据库,则可以找到相应数据库的Blocks文件架构,并调整表格以满足该结构。

数据库的字段network使用 CIDR 表示法。遗憾的是,MySQL 不提供处理该格式数据的任何功能,因此我们必须先将网络转换为其他格式,以便以后轻松查询。我们选择将网络表示为一对 IP 地址,它们分别是网络中的第一个和最后一个地址。我们将转换此字段,以便这两个 IP 地址都表示为十六进制数。

我们可以使用 数据库转换工具 将此字段转换为十六进制数。下载程序并将其安装到提取 CSV 文件的同一目录中后,即可运行它:


$ ./geoip2-csv-converter -block-file GeoIP2-City-Blocks-IPv4.csv -include-hex-range -output-file GeoIP2-City-Blocks-IPv4-Hex.csv
$ ./geoip2-csv-converter -block-file GeoIP2-City-Blocks-IPv6.csv -include-hex-range -output-file GeoIP2-City-Blocks-IPv6-Hex.csv

架构

现在我们可以创建一个名为的表geoip2_network来保存我们刚刚转换的数据。我们将使用类型来表示 IP 地址varbinary(16),该类型足够大,可以表示 128 位(16 字节)IPv6 地址。

create table geoip2_network (
  network_start varbinary(16) not null,
  network_end varbinary(16) not null,
  geoname_id int,
  registered_country_geoname_id int,
  represented_country_geoname_id int,
  is_anonymous_proxy bool,
  is_satellite_provider bool,
  postal_code text,
  latitude float,
  longitude float,
  accuracy_radius int,
  is_anycast bool,
  index(network_start),
  index(network_end)
);

network_start请注意,我们为和 添加了两个单独的索引network_end。如果我们在这两列上都使用复合索引,我们将无法加快稍后使用的查询速度。

将数据加载到网络表中

GeoIP2-City-Blocks-IPv4.csv我们现在可以将和 的内容导入GeoIP2-City-Blocks-IPv6.csv到我们刚刚创建的表中。

我们首先加载转换后的 IPv6 数据:

load data infile '/var/maxmind/GeoIP2-City-Blocks-IPv6-Hex.csv'
into table geoip2_network
fields terminated by ',' enclosed by '"' lines terminated by '\n' ignore 1 rows
(@network_start, @network_end, @geoname_id, @registered_country_geoname_id, @represented_country_geoname_id,
 @is_anonymous_proxy, @is_satellite_provider, @postal_code, @latitude, @longitude, @accuracy_radius)
set network_start = unhex(@network_start),
    network_end = unhex(@network_end),
    geoname_id = nullif(@geoname_id, ''),
    registered_country_geoname_id = nullif(@registered_country_geoname_id, ''),
    represented_country_geoname_id = nullif(@represented_country_geoname_id, ''),
    is_anonymous_proxy = nullif(@is_anonymous_proxy, ''),
    is_satellite_provider = nullif(@is_satellite_provider, ''),
    postal_code = nullif(@postal_code, ''),
    latitude = nullif(@latitude, ''),
    longitude = nullif(@longitude, ''),
    accuracy_radius = nullif(@accuracy_radius, '');
		

我们可以用同样的方式加载转换后的IPv4数据:

load data infile '/var/maxmind/GeoIP2-City-Blocks-IPv4-Hex.csv'
into table geoip2_network
fields terminated by ',' enclosed by '"' lines terminated by '\n' ignore 1 rows
(@network_start, @network_end, @geoname_id, @registered_country_geoname_id, @represented_country_geoname_id,
 @is_anonymous_proxy, @is_satellite_provider, @postal_code, @latitude, @longitude, @accuracy_radius)
set network_start = unhex(@network_start),
    network_end = unhex(@network_end),
    geoname_id = nullif(@geoname_id, ''),
    registered_country_geoname_id = nullif(@registered_country_geoname_id, ''),
    represented_country_geoname_id = nullif(@represented_country_geoname_id, ''),
    is_anonymous_proxy = nullif(@is_anonymous_proxy, ''),
    is_satellite_provider = nullif(@is_satellite_provider, ''),
    postal_code = nullif(@postal_code, ''),
    latitude = nullif(@latitude, ''),
    longitude = nullif(@longitude, ''),
    accuracy_radius = nullif(@accuracy_radius, '');
		

请注意,即使 CSV 文件中有表中缺少的额外列,数据也会被导入。

通过查询来测试我们的表

所有内容加载完毕后,我们现在可以在数据库中查找 IP 地址。由于我们将 IP 地址表示为varbinary(16),因此我们首先必须使用 MySQL 的内置inet6_aton函数将我们感兴趣的 IP 地址的文本表示转换为相同类型。

select geoname_id, registered_country_geoname_id, represented_country_geoname_id,
       postal_code, latitude, longitude, accuracy_radius
from geoip2_network
where inet6_aton('214.0.0.0') between network_start and network_end
limit 1;
+------------+-------------------------------+--------------------------------+-------------+----------+-----------+-----------------+
| geoname_id | registered_country_geoname_id | represented_country_geoname_id | postal_code | latitude | longitude | accuracy_radius |
+------------+-------------------------------+--------------------------------+-------------+----------+-----------+-----------------+
|    6252001 |                       6252001 |                           NULL | NULL        |   37.751 |   -97.822 |            1000 |
+------------+-------------------------------+--------------------------------+-------------+----------+-----------+-----------------+
1 row in set (0.03 sec)

虽然这会产生正确的结果,但我们注意到查询性能可以更好。让我们改进它。

对表格进行排序以便更快地进行搜索

加快查询速度的一种方法是添加order by network_end如下内容:

select geoname_id, registered_country_geoname_id, represented_country_geoname_id,
       postal_code, latitude, longitude, accuracy_radius
from geoip2_network
where inet6_aton('214.0.0.0') between network_start and network_end
order by network_end
limit 1;
+------------+-------------------------------+--------------------------------+-------------+----------+-----------+-----------------+
| geoname_id | registered_country_geoname_id | represented_country_geoname_id | postal_code | latitude | longitude | accuracy_radius |
+------------+-------------------------------+--------------------------------+-------------+----------+-----------+-----------------+
|    6252001 |                       6252001 |                           NULL | NULL        |   37.751 |   -97.822 |            1000 |
+------------+-------------------------------+--------------------------------+-------------+----------+-----------+-----------------+
1 row in set (0.00 sec)

虽然这解决了我们对上一个查询的性能担忧,但对于 GeoIP2 数据库中不包含的地址,此查询的性能仍然很差:

elect geoname_id, registered_country_geoname_id, represented_country_geoname_id,
       postal_code, latitude, longitude, accuracy_radius
from geoip2_network
where inet6_aton('127.0.0.1') between network_start and network_end
order by network_end
limit 1;
Empty set (4.45 sec)

分解查询以加快搜索速度

我们可以解决这个问题,将查询分成两部分,这样 MySQL 就能更有效地使用我们创建的索引:

select geoname_id, registered_country_geoname_id, represented_country_geoname_id,
       postal_code, latitude, longitude, accuracy_radius
from (
  select *
  from geoip2_network
  where inet6_aton('214.0.0.0') >= network_start
  order by network_start desc
  limit 1
) net
where inet6_aton('214.0.0.0') <= network_end;
+------------+-------------------------------+--------------------------------+-------------+----------+-----------+-----------------+
| geoname_id | registered_country_geoname_id | represented_country_geoname_id | postal_code | latitude | longitude | accuracy_radius |
+------------+-------------------------------+--------------------------------+-------------+----------+-----------+-----------------+
|    6252001 |                       6252001 |                           NULL | NULL        |   37.751 |   -97.822 |            1000 |
+------------+-------------------------------+--------------------------------+-------------+----------+-----------+-----------------+
1 row in set (0.00 sec)
select geoname_id, registered_country_geoname_id, represented_country_geoname_id,
       postal_code, latitude, longitude, accuracy_radius
from (
  select *
  from geoip2_network
  where inet6_aton('127.0.0.1') >= network_start
  order by network_start desc
  limit 1
) net
where inet6_aton('127.0.0.1') <= network_end;
Empty set (0.00 sec)

使用该构造可以为所有地址提供良好的查询性能,无论 GeoIP2 数据库是否包含有关这些地址的任何信息。根据您的应用程序,您可能需要考虑将这种复杂性/冗长性封装在一个函数中。或者,MySQL 还提供可用于实现类似性能的空间数据类型,同时允许更自然地表达查询。

可选:创建位置数据表

如果postal_codelatitudelongitudeaccuracy_radius是我们感兴趣的所有内容,那么到此为止,我们的应用程序将能够轻松查询所需的内容。但是,GeoIP2 数据库提供了额外的位置信息。请注意geoname_id我们网络表中的字段。此字段可用于从我们之前下载的文件中查找有关地理位置的其他信息Locations。接下来我们将这些数据加载到 MySQL 中。

位置表架构

我们首先像以前一样创建一个表。与文件一样Blocks,GeoIP2 和 GeoLite2 城市位置文件的架构可以在 数据库文档的 CSV 部分中找到。

我们将此表命名为geoip2_location

create table geoip2_location (
  geoname_id int not null,
  locale_code text not null,
  continent_code text,
  continent_name text,
  country_iso_code text,
  country_name text,
  subdivision_1_iso_code text,
  subdivision_1_name text,
  subdivision_2_iso_code text,
  subdivision_2_name text,
  city_name text,
  metro_code int,
  time_zone text,
  is_in_european_union bool,
  primary key (geoname_id, locale_code(5))
);

将数据加载到位置表中

然后,我们geoip2_locationLocationsCSV 文件填充表格。在本例中,我们将从 填充表格GeoIP2-City-Locations-en.csv。使用带有后缀的文件-en将为我们提供英文的地理位置名称:

 导入城市CSV
load data infile '/var/lib/mysql-files/GeoIP2-City-Locations-en.csv'
into table geoip2_location
fields terminated by ',' enclosed by '"' lines terminated by '\n' ignore 1 rows (
  geoname_id, locale_code, continent_code, continent_name,
  @country_iso_code, @country_name, @subdivision_1_iso_code, @subdivision_1_name,
  @subdivision_2_iso_code, @subdivision_2_name, @city_name, @metro_code, @time_zone,
  is_in_european_union
)
set country_iso_code = nullif(@country_iso_code, ''),
    country_name = nullif(@country_name, ''),
    subdivision_1_iso_code = nullif(@subdivision_1_iso_code, ''),
    subdivision_1_name = nullif(@subdivision_1_name, ''),
    subdivision_2_iso_code = nullif(@subdivision_2_iso_code, ''),
    subdivision_2_name = nullif(@subdivision_2_name, ''),
    city_name = nullif(@city_name, ''),
    metro_code = nullif(@metro_code, ''),
    time_zone = nullif(@time_zone, '');

导入国家

load data infile '/var/maxMind/GeoLite2-Country-CSV_20240614/GeoLite2-Country-Locations-en.csv'
into table geoip2_location

fields terminated by ',' enclosed by '"' lines terminated by '\n' ignore 1 rows (
  geoname_id, locale_code, continent_code, continent_name,
  @country_iso_code, @country_name,is_in_european_union
)
set country_iso_code = nullif(@country_iso_code, ''),
    country_name = nullif(@country_name, '');


		

请注意,有许多不同的Locations文件可用。其他具有不同语言后缀的文件包含-en 某些geoname_ids 的不同语言的本地化版本数据。根据应用程序的需求,您可以决定将其他Locations文件导入本地化表。例如,您可以加载GeoIP2-City-Locations-en.csv 到名为 的表中geoip2_location-en,并加载 GeoIP2-City-Locations-zh-CN.csv到名为 的表中geoip2_location-zh。然后,您可以分别查询您需要的英语或中文位置表。

查询我们的表格

我们现在可以使用我们的geoip2_location表来解析表geoname_id提供的内容geoip2_network。例如:

select latitude, longitude, accuracy_radius, continent_name, country_name, subdivision_1_name, city_name
from (
  select *
  from geoip2_network
  where inet6_aton('214.0.0.0') >= network_start
  order by network_start desc
  limit 1
) net
left join geoip2_location location on (
  net.geoname_id = location.geoname_id and location.locale_code = 'en'
)
where inet6_aton('214.0.0.0') <= network_end;
+----------+-----------+-----------------+----------------+---------------+--------------------+-----------+
| latitude | longitude | accuracy_radius | continent_name | country_name  | subdivision_1_name | city_name |
+----------+-----------+-----------------+----------------+---------------+--------------------+-----------+
|   37.751 |   -97.822 |            1000 | North America  | United States | NULL               | NULL      |
+----------+-----------+-----------------+----------------+---------------+--------------------+-----------+
1 row in set (0.00 sec)

这里我们只对英语结果感兴趣,但如果我们对不同或其他语言感兴趣,我们可以调整我们的连接条件。

请注意左外连接是如何使用的。这是因为我们的geoip2_network 表的任何给定行可能都没有可用的附加位置信息。例如,某些 IP 地址无法解析为城市或分区。如果可用,使用左连接我们仍会收到latitudelongitude和 accuracy_radius作为查询结果,而如果没有可用的附加位置信息,则内连接将导致零行。

除了geoname_id提供网络位置信息的列之外,还有 和registered_country_geoname_id, represented_country_geoname_id分别提供有关 ISP 注册网络的国家/地区和 IP 地址用户所代表的国家/地区的位置信息。 两者的位置数据都可以通过其他连接来包含:

select latitude, longitude, accuracy_radius,
       location.continent_name as location_continent_name,
       location.country_name as location_country_name,
       location.subdivision_1_name as location_subdivision_1_name,
       location.city_name as location_city_name,
       registered_country.continent_name as registered_country_continent_name,
       registered_country.country_name as registered_country_country_name,
       represented_country.continent_name as represented_country_continent_name,
       represented_country.country_name as represented_country_country_name
from (
  select *
  from geoip2_network
  where inet6_aton('214.0.0.0') >= network_start
  order by network_start desc
  limit 1
) net
left join geoip2_location location on (
  net.geoname_id = location.geoname_id and location.locale_code = 'en'
)
left join geoip2_location registered_country on (
  net.registered_country_geoname_id = registered_country.geoname_id
  and registered_country.locale_code = 'en'
)
left join geoip2_location represented_country on (
  net.represented_country_geoname_id = represented_country.geoname_id
  and represented_country.locale_code = 'en'
)
where inet6_aton('214.0.0.0') <= network_end;
+----------+-----------+-----------------+-------------------------+-----------------------+-----------------------------+--------------------+-----------------------------------+---------------------------------+------------------------------------+----------------------------------+
| latitude | longitude | accuracy_radius | location_continent_name | location_country_name | location_subdivision_1_name | location_city_name | registered_country_continent_name | registered_country_country_name | represented_country_continent_name | represented_country_country_name |
+----------+-----------+-----------------+-------------------------+-----------------------+-----------------------------+--------------------+-----------------------------------+---------------------------------+------------------------------------+----------------------------------+
|   37.751 |   -97.822 |            1000 | North America           | United States         | NULL                        | NULL               | North America                     | United States                   | NULL                               | NULL                             |
+----------+-----------+-----------------+-------------------------+-----------------------+-----------------------------+--------------------+-----------------------------------+---------------------------------+------------------------------------+----------------------------------+
1 row in set (0.00 sec)

node 使用

github 文档地址icon-default.png?t=N7T8https://github.com/maxmind/GeoIP2-node#city-example

1. 导入模块

npm install @maxmind/geoip2-node

2. node使用

import { Reader } from "@maxmind/geoip2-node";

const path = require("path");
const databasePath = path.resolve(__dirname, "../../../GeoLite2-Country.mmdb");

export default class IpCenterV2 {

//获取国家code
public async getIP(ip: any) {
    const result = Reader.open(databasePath)
      .then((reader) => {
        return reader.country(ip)?.country?.isoCode;
      })
      .catch((error) => {
        console.error("Error opening MMDB:", error);
        return undefined;
      });

    return result || undefined;
  }

}


#调用
 const bIpDb = new IpCenterV2();

et res = await bIpDb.getCountryISOCode(ip);

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

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

相关文章

vite-plugin-mock前端自行模拟接口返回数据的插件

vite-plugin-mock前端自行模拟接口返回数据的插件 安装导入、配置&#xff08;vite.config.js&#xff09;使用目录结构/mock/user.js具体在页面请求中的使用 注意事项 中文文档&#xff1a;[https://gitcode.com/vbenjs/vite-plugin-mock/blob/main/README.zh_CN.md) 参考其他…

区间预测 | Matlab实现BP-ABKDE的BP神经网络自适应带宽核密度估计多变量回归区间预测

区间预测 | Matlab实现BP-ABKDE的BP神经网络自适应带宽核密度估计多变量回归区间预测 目录 区间预测 | Matlab实现BP-ABKDE的BP神经网络自适应带宽核密度估计多变量回归区间预测效果一览基本介绍程序设计参考资料 效果一览 基本介绍 1.Matlab实现BP-ABKDE的BP神经网络自适应带…

深入理解计算机系统 CSAPP 家庭作业6.34

第一步先求(S,E,B,m) 题目说共C32个字节,块大小B为16个字节,那就是分为两组:0,1.然后每组存4个int 每个4字节 CB*E*S .B16 ,直接映射的E就是1,所以S2 m为啥等于7? 通过写出两个数组所有的地址可以得出m7. 得出高速缓存的参数:(S,E,B,m)(2,1,16,7),注意图6-26每个参数的定义…

官网首屏:太漂亮了,真是着了它的魔,上了它的道。

大气的企业官网致力于提供用户友好的界面和优质的用户体验。网页经过精心设计和开发&#xff0c;旨在展示客户的品牌形象和产品信息&#xff0c;并为用户提供便捷的服务和沟通渠道。 官网设计追求简洁、美观、易用的原则&#xff0c;以吸引用户的注意力并提供清晰的导航和信息…

【MySQL】(基础篇十一) —— 分组数据

分组数据 本文介绍如何分组数据&#xff0c;以便能汇总表内容的子集。这涉及两个新SELECT语句子句&#xff0c;分别是GROUP BY子句和HAVING子句。 数据分组 经过上一节的学习&#xff0c;我们可以使用聚集函数查找到某个个工种拥有的员工数量&#xff08;count函数&#xff…

iCloud200g教育版云盘热点问题被锁根本原因经验博文

内幕现象 关于iCloud账号购买&#xff0c;笔者以为从某多闲鱼某宝都是不靠谱的&#xff0c;因为这些地方都是搞无货源模式&#xff0c;商家不是管理员只是倒卖的中介&#xff0c;而且这些平台是禁止交易虚拟网络账号的&#xff0c;所以很多这些平台商家都是以极低的价格出售快…

后端项目怎么做?怎么准备面试,看这篇就够了!

近期群友都在海投&#xff0c;广撒网&#xff0c;为的就是等一个面试机会&#xff0c;等一个offer。 当收到面试通知的时候&#xff0c;大家一定要好好把握机会。 机会很重要&#xff0c;给你机会&#xff0c;没有把握住&#xff0c;那就比较尴尬了。 对于研发岗位来说&…

sqoop的安装配置

1. 上传并解压安装包 tar -zxvf sqoop-1.4.7.bin__hadoop-2.6.0.tar.gz -C ../server/ 重命名&#xff1a;mv sqoop-1.4.7.bin__hadoop-2.6.0 sqoop 2. 配置环境变量 sudo vim /etc/profile # 配置sqoop的环境变量 export SQOOP_HOME/export/server/sqoop export PATH$PATH…

增加软件投入的重要性:提升自动化程度与用户界面设计的价值

一、引言 在许多项目中&#xff0c;硬件系统通常占据了大量预算&#xff0c;而对软件的投入相对较少。这种不平衡往往导致软件自动化程度低、操作不便、界面简陋&#xff0c;过多的人工干预不仅降低了工作效率&#xff0c;还影响了用户体验。特别是对于一些国家项目&#xff0…

大语言模型QA

Q:关于 Yi-9B 通过 input/output cosine 来分析模型,可能文档里没有把前提说明白。该指标确实存在你们提到的不同模型大小不可比的问题。所以我们比较的是同一个模型在不同训练阶段,以及 layer 深度相同的dense models 之间的比较。除了发现yi-6B/34B 随着训练 tokens 的增加…

UML与设计模式

1、关联关系 关联关系用于描述不同类的对象之间的结构关系&#xff0c;它在一段时间内将多个类的实例连接在一起。关联关系是一种静态关系&#xff0c;通常与运行状态无关&#xff0c;而是由“常识”、“规则”、“法律”等因素决定的&#xff0c;因此关联关系是一种强关联的关…

UFS协议入门-UPIU帧结构

写在前面:本文参考UFS jedec3.1,本文思维导图如下 1. UPIU整体结构 UPIU的结构由帧头和数据两个构成,其中帧头Header为12B,数据data最小为20B,UPIU最小为32B,最大为6500B。如下图所示。 2. UPIU包头结构 对于帧头,固定结构如下图所示,后面分贝介绍每个位的含义。 2.1…

34 Debian如何配置ELK群集

作者:网络傅老师 特别提示:未经作者允许,不得转载任何内容。违者必究! Debian如何配置ELK群集 《傅老师Debian知识库系列之34》——原创 ==前言== 傅老师Debian知识库特点: 1、拆解Debian实用技能; 2、所有操作在VMware虚拟机实测完成; 3、致力于最终形成Debian知识手…

【前端】HTML5基础

目录 0 参考1 网页1.1 什么是网页1.2 什么是HTML1.3 网页的形成 2 浏览器2.1 常用的浏览器2.2 浏览器内核 3 Web标准3.1 为什么需要Web标准3.2 Web标准的构成 4 HTML 标签4.1 HTML语法规范4.1.1 基本语法概述4.1.2 标签关系4.1.2.1 包含关系4.1.2.2 并列关系 4.2 HTML基本结构标…

JS读取目录下的所有图片/require动态加载图片/文字高亮

<template class"aa"><div class"demo-image__lazy container"><div class"head"><div class"left-bar"><div><span>综合</span></div><div><span>定位</span><…

快速构建本地RAG聊天机器人:使用LangFlow和Ollama实现无代码开发

基于LangChain的快速RAG应用原型制作方法 还记得构建智能聊天机器人需要数月编码的日子吗&#xff1f; LangChain这样的框架确实简化了开发流程&#xff0c;但对非程序员来说&#xff0c;数百行代码仍然是一道门槛。 有没有更简单的方法呢&#xff1f; 图片由 Ravi Palwe 在…

Qt 6.13

作业&#xff1a; #include "mywidget.h"mywidget::mywidget(QWidget *parent): QWidget(parent) {this->setStyleSheet("background-color:white");this->resize(600,600);this->setWindowFlag(Qt::FramelessWindowHint);this->setWindowTit…

掌握特劳特定位理论核心,明晰企业战略定位之重

在当今瞬息万变的市场环境中&#xff0c;企业战略定位的重要性日益凸显。它不仅是企业在激烈竞争中保持优势的关键&#xff0c;更是企业实现长期可持续发展的基石。 哈佛大学战略学教授迈克尔波特&#xff08;Michael Porter&#xff09;指出战略就是形成一套独具的运营活动&a…

vue实现拖拽元素;vuedraggable拖拽插件

效果图&#xff1a; 中文文档 以下代码可直接复制使用 安装依赖 npm i -S vuedraggable使用 <template><div class"container"><div>使用flex竖轴布局 <br>handle".mover" 可拖拽的class类名 <br>filter".forbid&qu…

SQL Server Management Studio (SSMS) 20.1 - 微软数据库管理工具

SQL Server Management Studio (SSMS) 20.1 - 微软数据库管理工具 请访问原文链接&#xff1a;https://sysin.org/blog/ssms/&#xff0c;查看最新版。原创作品&#xff0c;转载请保留出处。 作者主页&#xff1a;sysin.org 笔者注&#xff1a;SQL Server 2014 及之前版本内置…