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

Oracle Linux8 安装 MySQL 8.4.3,搭建一主一从

文章目录

  • 安装依赖
  • 获取安装包
  • 解压
  • 准备相关目录
  • 设置配置文件
  • 启动数据库
  • 连接数据库
  • socket 文件优化
  • 同样方法准备 3307 数据库实例
  • 设置配置文件
  • 启动 3307 实例数据库
  • 连接并查看 3307 数据库实例
  • 基于 bin log 搭建主从模式

安装依赖

yum install -y numactl libaio ncurses-compat-libs

获取安装包

[root@oracleLinux8 mysql]# ll /root/mysql-8.4.3-linux-glibc2.17-aarch64.tar.xz
-rw-r--r-- 1 root root 896423176 Apr 20 21:40 /root/mysql-8.4.3-linux-glibc2.17-aarch64.tar.xz

解压

cd /root
tar xf mysql*xz -C /usr/local/
ln -s /usr/local/mysql-8.4.3-linux-glibc2.17-aarch64 /usr/local/mysql

准备相关目录

cd /usr/local/mysql
mkdir -p 3306/{data,socket,error_log,slow_error_log,pid_log,file}
/usr/local/mysql/bin/mysqld --initialize --user=mysql  --datadir=/usr/local/mysql/3306/data2025-04-20T14:08:36.281629Z 0 [System] [MY-015017] [Server] MySQL Server Initialization - start.
2025-04-20T14:08:36.283506Z 0 [System] [MY-013169] [Server] /usr/local/mysql/bin/mysqld (mysqld 8.4.3) initializing of server in progress as process 2983
2025-04-20T14:08:36.296320Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
get_mempolicy: Function not implemented
2025-04-20T14:08:36.299476Z 1 [Warning] [MY-011873] [InnoDB] Failed to set NUMA memory policy to MPOL_INTERLEAVE: Function not implemented
get_mempolicy: Function not implemented
2025-04-20T14:08:36.299650Z 0 [Warning] [MY-011879] [InnoDB] Failed to set NUMA memory policy of buffer pool page frames with mbind(0xffff77d10000,137297920,MPOL_INTERLEAVE,...,...,MPOL_MF_MOVE) failed with Function not implemented
2025-04-20T14:08:36.303475Z 1 [Warning] [MY-011875] [InnoDB] Failed to set NUMA memory policy to MPOL_DEFAULT: Function not implemented
2025-04-20T14:08:36.564595Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2025-04-20T14:08:37.648592Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: !s:Cll=ey4Wz
2025-04-20T14:08:39.366449Z 0 [System] [MY-015018] [Server] MySQL Server Initialization - end.

设置配置文件

cat > /usr/local/mysql/3306/data/my.cnf <<"EOF"
[mysqld]
# Basic Settings
user = mysql
basedir = /usr/local/mysql
datadir = /usr/local/mysql/3306/data
socket = /usr/local/mysql/3306/socket/mysql.sock
pid-file = /usr/local/mysql/3306/pid_log/mysql.pid
secure_file_priv = /usr/local/mysql/3306/file
log-bin=mysql-bin
server_id=1
mysql_native_password=ON
innodb_flush_log_at_trx_commit=1
sync_binlog=1# Network
port = 3306
bind-address = 0.0.0.0# Logging
log_error = /usr/local/mysql/3306/error_log/mysql-error.log
slow_query_log = 1
slow_query_log_file = /usr/local/mysql/3306/slow_error_log/mysql-slow.log
long_query_time = 2# InnoDB Settings
innodb_buffer_pool_size = 128M
innodb_log_file_size = 64M
innodb_file_per_table = 1
innodb_flush_log_at_trx_commit = 1# Security
skip-name-resolve
local-infile = 0# Performance
max_connections = 100
thread_cache_size = 8
table_open_cache = 1000[client]
socket = /usr/local/mysql/3306/socket/mysql.sock
port = 3306[mysql]
socket = /usr/local/mysql/3306/socket/mysql.sock
auto-rehash
EOF

启动数据库

touch /usr/local/mysql/3306/error_log/mysql-error.log
mkdir -p /usr/local/mysql/file
chown mysql:mysql -R /usr/local/mysql/
chown mysql:mysql -R /usr/local/mysql/3306/*/usr/local/mysql/bin/mysqld_safe --defaults-file=/usr/local/mysql/3306/data/my.cnf &[root@oracleLinux8 mysql]#  /usr/local/mysql/bin/mysqld_safe --defaults-file=/usr/local/mysql/3306/data/my.cnf &
[1] 5743
[root@oracleLinux8 mysql]# 2025-04-20T14:21:31.458910Z mysqld_safe Logging to '/usr/local/mysql/3306/error_log/mysql-error.log'.
2025-04-20T14:21:31.468890Z mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/3306/data[root@oracleLinux8 mysql]#
[root@oracleLinux8 mysql]# ps -ef |grep mysql
root        5743    2266  0 22:21 pts/1    00:00:00 /bin/sh /usr/local/mysql/bin/mysqld_safe --defaults-file=/usr/local/mysql/3306/data/my.cnf
mysql       6093    5743 11 22:21 pts/1    00:00:00 /usr/local/mysql/bin/mysqld --defaults-file=/usr/local/mysql/3306/data/my.cnf --basedir=/usr/local/mysql --datadir=/usr/local/mysql/3306/data --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=/usr/local/mysql/3306/error_log/mysql-error.log --pid-file=/usr/local/mysql/3306/pid_log/mysql.pid --socket=/usr/local/mysql/3306/socket/mysql.sock --port=3306
root        6138    2266  0 22:21 pts/1    00:00:00 grep --color=auto mysql
[root@oracleLinux8 mysql]#
[root@oracleLinux8 mysql]#
[root@oracleLinux8 mysql]# ss -tunlp | grep mysql
tcp   LISTEN 0      100          0.0.0.0:3306       0.0.0.0:*    users:(("mysqld",pid=6093,fd=22))
tcp   LISTEN 0      70                 *:33060            *:*    users:(("mysqld",pid=6093,fd=18))

连接数据库

/usr/local/mysql/bin/mysql -u root -p  -S /usr/local/mysql/3306/socket/mysql.sock
密码在前面日志中有 !s:Cll=ey4Wzmysql> alter user user() identified by 'root';
Query OK, 0 rows affected (0.02 sec)mysql> select user,host from mysql.user;
+------------------+-----------+
| user             | host      |
+------------------+-----------+
| mysql.infoschema | localhost |
| mysql.session    | localhost |
| mysql.sys        | localhost |
| root             | localhost |
+------------------+-----------+
4 rows in set (0.00 sec)

socket 文件优化

每次登录, 输入 socket 文件过长,比较麻烦

cat >> ~/.bash_profile <<"EOF"
export MYSQL_UNIX_PORT=/usr/local/mysql/3306/socket/mysql.sock
export PATH=/usr/local/mysql/bin:$PATH
EOF
. ~/.bash_profile再次登录
[root@oracleLinux8 mysql]# mysql -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 13
Server version: 8.4.3 MySQL Community Server - GPLCopyright (c) 2000, 2024, 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>查看状态
[root@oracleLinux8 mysql]# mysql -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 13
Server version: 8.4.3 MySQL Community Server - GPLCopyright (c) 2000, 2024, 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>  select user();
+----------------+
| user()         |
+----------------+
| root@localhost |
+----------------+
1 row in set (0.02 sec)mysql> select version();
+-----------+
| version() |
+-----------+
| 8.4.3     |
+-----------+
1 row in set (0.00 sec)mysql> status;
--------------
mysql  Ver 8.4.3 for Linux on aarch64 (MySQL Community Server - GPL)Connection id:		13
Current database:
Current user:		root@localhost
SSL:			Not in use
Current pager:		stdout
Using outfile:		''
Using delimiter:	;
Server version:		8.4.3 MySQL Community Server - GPL
Protocol version:	10
Connection:		Localhost via UNIX socket
Server characterset:	utf8mb4
Db     characterset:	utf8mb4
Client characterset:	utf8mb4
Conn.  characterset:	utf8mb4
UNIX socket:		/usr/local/mysql/3306/socket/mysql.sock
Binary data as:		Hexadecimal
Uptime:			7 min 35 secThreads: 2  Questions: 21  Slow queries: 0  Opens: 130  Flush tables: 3  Open tables: 46  Queries per second avg: 0.046
--------------

同样方法准备 3307 数据库实例

mkdir -p 3307/{data,error_log,slow_error_log,socket,pid_log,file}
chown -R  mysql:mysql 3307[root@oracleLinux8 3307]# /usr/local/mysql/bin/mysqld --initialize --user=mysql  --datadir=/usr/local/mysql/3307/data
2025-04-20T14:52:26.584588Z 0 [System] [MY-015017] [Server] MySQL Server Initialization - start.
2025-04-20T14:52:26.586051Z 0 [System] [MY-013169] [Server] /usr/local/mysql/bin/mysqld (mysqld 8.4.3) initializing of server in progress as process 7278
2025-04-20T14:52:26.611537Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
get_mempolicy: Function not implemented
2025-04-20T14:52:26.615731Z 1 [Warning] [MY-011873] [InnoDB] Failed to set NUMA memory policy to MPOL_INTERLEAVE: Function not implemented
get_mempolicy: Function not implemented
2025-04-20T14:52:26.616091Z 0 [Warning] [MY-011879] [InnoDB] Failed to set NUMA memory policy of buffer pool page frames with mbind(0xffff67d10000,137297920,MPOL_INTERLEAVE,...,...,MPOL_MF_MOVE) failed with Function not implemented
2025-04-20T14:52:26.622379Z 1 [Warning] [MY-011875] [InnoDB] Failed to set NUMA memory policy to MPOL_DEFAULT: Function not implemented
2025-04-20T14:52:26.808322Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2025-04-20T14:52:28.185961Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: BwtrQvcy-0_q
2025-04-20T14:52:29.564978Z 0 [System] [MY-015018] [Server] MySQL Server Initialization - end.

设置配置文件

cat > /usr/local/mysql/3307/data/my.cnf <<"EOF"
[mysqld]
# Basic Settings
user = mysql
basedir = /usr/local/mysql
datadir = /usr/local/mysql/3307/data
socket = /usr/local/mysql/3307/socket/mysql.sock
pid-file = /usr/local/mysql/3307/pid_log/mysql.pid
secure_file_priv = /usr/local/mysql/3307/file
log-bin=mysql-bin
server_id=2
mysql_native_password=ON
innodb_flush_log_at_trx_commit=1
sync_binlog=1# Network
port = 3307
bind-address = 0.0.0.0# 调整X插件配置(避免端口和socket冲突)
mysqlx_port = 33070
mysqlx_socket = /tmp/mysqlx3307.sock# Logging
log_error = /usr/local/mysql/3307/error_log/mysql-error.log
slow_query_log = 1
slow_query_log_file = /usr/local/mysql/3307/slow_error_log/mysql-slow.log
long_query_time = 2# InnoDB Settings
innodb_buffer_pool_size = 128M
innodb_log_file_size = 64M
innodb_file_per_table = 1
innodb_flush_log_at_trx_commit = 1# Security
skip-name-resolve
local-infile = 0# Performance
max_connections = 100
thread_cache_size = 8
table_open_cache = 1000[client]
socket = /usr/local/mysql/3307/socket/mysql.sock
port = 3307[mysql]
socket = /usr/local/mysql/3307/socket/mysql.sock
auto-rehash
EOF

主要修改 server_id 与如下两个配置
mysqlx_port = 33070
mysqlx_socket = /tmp/mysqlx3307.sock

启动 3307 实例数据库

[root@oracleLinux8 3307]# /usr/local/mysql/bin/mysqld_safe --defaults-file=/usr/local/mysql/3307/data/my.cnf &
2025-04-20T14:56:00.541265Z mysqld_safe Logging to '/usr/local/mysql/3307/error_log/mysql-error.log'.
2025-04-20T14:56:00.551499Z mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/3307/data[root@oracleLinux8 3307]# ss -tunlp |grep mysql
tcp   LISTEN 0      100          0.0.0.0:3306       0.0.0.0:*    users:(("mysqld",pid=6093,fd=22))
tcp   LISTEN 0      100          0.0.0.0:3307       0.0.0.0:*    users:(("mysqld",pid=7700,fd=22))
tcp   LISTEN 0      70                 *:33060            *:*    users:(("mysqld",pid=6093,fd=18))
tcp   LISTEN 0      70                 *:33070            *:*    users:(("mysqld",pid=7700,fd=18))

连接并查看 3307 数据库实例

密码在之前初始化的打印中

[root@oracleLinux8 3307]# mysql -p -S /usr/local/mysql/3307/socket/mysql.sock
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 11
Server version: 8.4.3Copyright (c) 2000, 2024, 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> select version();
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
mysql> alter user user() identified by 'root';
Query OK, 0 rows affected (0.05 sec)mysql> select version();
+-----------+
| version() |
+-----------+
| 8.4.3     |
+-----------+
1 row in set (0.00 sec)mysql> select user();
+----------------+
| user()         |
+----------------+
| root@localhost |
+----------------+
1 row in set (0.00 sec)mysql> select user,host from mysql.user;
+------------------+-----------+
| user             | host      |
+------------------+-----------+
| mysql.infoschema | localhost |
| mysql.session    | localhost |
| mysql.sys        | localhost |
| root             | localhost |
+------------------+-----------+
4 rows in set (0.00 sec)mysql> status;
--------------
mysql  Ver 8.4.3 for Linux on aarch64 (MySQL Community Server - GPL)Connection id:		11
Current database:
Current user:		root@localhost
SSL:			Not in use
Current pager:		stdout
Using outfile:		''
Using delimiter:	;
Server version:		8.4.3
Protocol version:	10
Connection:		Localhost via UNIX socket
Server characterset:	utf8mb4
Db     characterset:	utf8mb4
Client characterset:	utf8mb4
Conn.  characterset:	utf8mb4
UNIX socket:		/usr/local/mysql/3307/socket/mysql.sock
Binary data as:		Hexadecimal
Uptime:			4 min 20 secThreads: 2  Questions: 11  Slow queries: 0  Opens: 130  Flush tables: 3  Open tables: 46  Queries per second avg: 0.042
--------------

基于 bin log 搭建主从模式

规划: 3306 是主库; 3307 实例是从库

  • 主库
create USER 'repuser'@'%' IDENTIFIED WITH mysql_native_password BY 'repuser' ;
GRANT REPLICATION SLAVE ON *.* TO 'repuser'@'%';
FLUSH PRIVILEGES;SHOW BINARY LOG STATUS
+------------------+----------+--------------+------------------+-------------------+
| File             | Position | Binlog_Do_DB | Binlog_Ignore_DB | Executed_Gtid_Set |
+------------------+----------+--------------+------------------+-------------------+
| mysql-bin.000008 |      443 |              |                  |                   |
+------------------+----------+--------------+------------------+-------------------+
  • 从库
stop replica;
change replication source to source_host='127.0.0.1', source_port=3306, source_user='repuser', source_password='repuser', source_log_file='mysql-bin.000008', source_log_pos=443;
show replica status\G第一次报错如下:Last_IO_Errno: 2061Last_IO_Error: Error connecting to source 'repuser@127.0.0.1:3306'. This was attempt 6/10, with a delay of 60 seconds between attempts. Message: Authentication plugin 'caching_sha2_password' reported error: Authentication requires secure connection.然后在主库与从库配置文件的 mysqld 中 , 都启用了 mysql_native_password=on, 然后重启了数据库服务
然后同步状态正常如下;
mysql> show replica status\G
*************************** 1. row ***************************Replica_IO_State: Waiting for source to send eventSource_Host: 127.0.0.1Source_User: repuserSource_Port: 3306Connect_Retry: 60Source_Log_File: mysql-bin.000009Read_Source_Log_Pos: 158Relay_Log_File: oracleLinux8-relay-bin.000002Relay_Log_Pos: 328Relay_Source_Log_File: mysql-bin.000009Replica_IO_Running: YesReplica_SQL_Running: YesReplicate_Do_DB:Replicate_Ignore_DB:Replicate_Do_Table:Replicate_Ignore_Table:Replicate_Wild_Do_Table:Replicate_Wild_Ignore_Table:Last_Errno: 0Last_Error:Skip_Counter: 0Exec_Source_Log_Pos: 158Relay_Log_Space: 546Until_Condition: NoneUntil_Log_File:Until_Log_Pos: 0Source_SSL_Allowed: NoSource_SSL_CA_File:Source_SSL_CA_Path:Source_SSL_Cert:Source_SSL_Cipher:Source_SSL_Key:Seconds_Behind_Source: 0
Source_SSL_Verify_Server_Cert: NoLast_IO_Errno: 0Last_IO_Error:Last_SQL_Errno: 0Last_SQL_Error:Replicate_Ignore_Server_Ids:Source_Server_Id: 1Source_UUID: f37cc1a2-1df0-11f0-a107-92faf2fcb2f7Source_Info_File: mysql.slave_master_infoSQL_Delay: 0SQL_Remaining_Delay: NULLReplica_SQL_Running_State: Replica has read all relay log; waiting for more updatesSource_Retry_Count: 10Source_Bind:Last_IO_Error_Timestamp:Last_SQL_Error_Timestamp:Source_SSL_Crl:Source_SSL_Crlpath:Retrieved_Gtid_Set:Executed_Gtid_Set:Auto_Position: 0Replicate_Rewrite_DB:Channel_Name:Source_TLS_Version:Source_public_key_path:Get_Source_public_key: 0Network_Namespace:
1 row in set (0.00 sec)-- 主库
mysql>  create database test2;
mysql> use test2;
Database changed
mysql> show tables;
Empty set (0.00 sec)mysql> create table test(id int );
Query OK, 0 rows affected (0.06 sec)mysql> insert into test values(1),(2);
Query OK, 2 rows affected (0.02 sec)
Records: 2  Duplicates: 0  Warnings: 0-- 从库
mysql> use test2;
Database changed
mysql> show tables;
+-----------------+
| Tables_in_test2 |
+-----------------+
| test            |
+-----------------+
1 row in set (0.00 sec)mysql> select * from test;
+------+
| id   |
+------+
|    1 |
|    2 |
+------+
2 rows in set (0.00 sec)mysql>   

相关文章:

Oracle Linux8 安装 MySQL 8.4.3,搭建一主一从

文章目录 安装依赖获取安装包解压准备相关目录设置配置文件启动数据库连接数据库socket 文件优化同样方法准备 3307 数据库实例设置配置文件启动 3307 实例数据库连接并查看 3307 数据库实例基于 bin log 搭建主从模式 安装依赖 yum install -y numactl libaio ncurses-compat…...

【JavaWeb后端开发04】java操作数据库(JDBC + Mybatis+ yml格式)详解

文章目录 1. 前言2. JDBC2.1 介绍2.2 入门程序2.2.1 DataGrip2.2.2 在IDEA执行sql语句 2.3 查询数据案例2.3.1 需求2.3.2 准备工作2.3.3 AI代码实现2.3.4 代码剖析2.3.4.1 ResultSet2.3.4.2 预编译SQL2.3.4.2.1 SQL注入2.3.4.2.2 SQL注入解决2.3.4.2.3 性能更高 2.4 增删改数据…...

postman 删除注销账号

一、删除账号 1.右上角找到 头像&#xff0c;view profile https://123456-6586950.postman.co/settings/me/account 二、找回账号 1.查看日志所在位置 三、postman更新后只剩下history 在 Postman 中&#xff0c;如果你发现更新后只剩下 History&#xff08;历史记录&…...

Java发展史及版本详细说明

Java发展史及版本详细说明 1. Java 1.0&#xff08;1996年1月23日&#xff09; 核心功能&#xff1a; 首个正式版本&#xff0c;支持面向对象编程、垃圾回收、网络编程。包含基础类库&#xff08;java.lang、java.io、java.awt&#xff09;。支持Applet&#xff08;浏览器嵌入…...

React 5 种组件提取思路与实践

在开发时,经常遇到一些高度重复但略有差异的 UI 模式,此时我们当然会把组件提取出去,但是组件提取的方式有很多,怎么根据不同场景选取合适的方式呢?尤其时在复杂的业务场景中,组件提取的思路影响着着代码的可维护性、可读性以及扩展性。本文将以一个[详情]组件为例,探讨…...

[java八股文][Java基础面试篇]I/O

Java怎么实现网络IO高并发编程&#xff1f; 可以用 Java NIO &#xff0c;是一种同步非阻塞的I/O模型&#xff0c;也是I/O多路复用的基础。 传统的BIO里面socket.read()&#xff0c;如果TCP RecvBuffer里没有数据&#xff0c;函数会一直阻塞&#xff0c;直到收到数据&#xf…...

数据结构-冒泡排序(Python)

目录 冒泡排序算法思想 冒泡排序算法步骤 冒泡排序代码实现 冒泡排序算法分析 冒泡排序算法思想 冒泡排序&#xff08;Bubble Sort&#xff09;基本思想&#xff1a; 经过多次迭代&#xff0c;通过相邻元素之间的比较与交换&#xff0c;使值较小的元素逐步从后面移到前面…...

Java单例模式详解:实现线程安全的全局访问点

精心整理了最新的面试资料和简历模板&#xff0c;有需要的可以自行获取 点击前往百度网盘获取 点击前往夸克网盘获取 一、什么是单例模式&#xff1f; 单例模式&#xff08;Singleton Pattern&#xff09;是一种创建型设计模式&#xff0c;它保证一个类仅有一个实例&#xff…...

React-组件和props

1、类组件 import React from react; class ClassApp extends React.Component {constructor(props) {super(props);this.state{};}render() {return (<div><h1>这是一个类组件</h1><p>接收父组件传过来的值&#xff1a;{this.props.name}</p>&…...

Java面试:从Spring Boot到微服务的全面考核

Java面试&#xff1a;从Spring Boot到微服务的全面考核 场景设定&#xff1a; 在一家互联网大厂的面试室内&#xff0c;严肃的面试官正准备开始对前来面试的赵大宝进行技术考核。赵大宝是一位自称在Java开发方面经验丰富的求职者&#xff0c;不过却是个搞笑的水货程序员。 第…...

深入理解React高阶组件(HOC):原理、实现与应用实践

组件复用的艺术 在React应用开发中&#xff0c;随着项目规模的增长&#xff0c;组件逻辑的复用变得越来越重要。传统的组件复用方式如组件组合和props传递在某些复杂场景下显得力不从心。高阶组件&#xff08;Higher-Order Component&#xff0c;简称HOC&#xff09;作为React中…...

Neo4j社区版在win下安装教程(非docker环境)

要在 Windows 10 上安装 Neo4j 社区版数据库并且不使用 Docker Desktop&#xff0c;你可以按照以下步骤操作&#xff1a; 1. 安装 Java Development Kit (JDK) Neo4j 需要 Java 运行环境。推荐安装 JDK 17 或 JDK 11&#xff08;请根据你下载的 Neo4j 版本查看具体的兼容性要…...

【AI 加持下的 Python 编程实战 2_10】DIY 拓展:从扫雷小游戏开发再探问题分解与 AI 代码调试能力(中)

文章目录 DIY 实战&#xff1a;从扫雷小游戏开发再探问题分解能力3 问题分解实战&#xff08;自顶向下&#xff09;3.2 页面渲染逻辑3.3 事件绑定逻辑 4 代码实现&#xff08;自底向上&#xff09;4.1 页面渲染部分4.2 事件绑定部分 写在前面 本篇将利用《Learn AI-assisted Py…...

使用PHP对接印度尼西亚股票市场

在本篇文章中&#xff0c;我们将介绍如何使用PHP语言与StockTV API接口对接&#xff0c;获取并处理印度尼西亚&#xff08;Indonesia&#xff09;的股票市场数据。我们将以查询IPO信息和查看涨跌排行榜为例&#xff0c;展示具体的操作流程。 准备工作 首先&#xff0c;确保您…...

如何在 Odoo 18 中配置自动化动作

如何在 Odoo 18 中配置自动化动作 Odoo是一款多功能的业务管理平台&#xff0c;旨在帮助各种规模的企业更高效地处理日常运营。凭借其涵盖销售、库存、客户关系管理&#xff08;CRM&#xff09;、会计和人力资源等领域的多样化模块&#xff0c;Odoo 简化了业务流程&#xff0c…...

node.js 实战——(Http 知识点学习)

HTTP 又称为超文本传输协议 是一种基于TCP/IP的应用层通信协议&#xff1b;这个协议详细规定了 浏览器 和万维网 服务器 之间互相通信的规则。协议中主要规定了两个方面的内容&#xff1a; 客户端&#xff1a;用来向服务器发送数据&#xff0c;可以被称之为请求报文服务端&am…...

新市场环境下新能源汽车电流传感技术发展前瞻

新能源革命重构产业格局 在全球碳中和战略驱动下&#xff0c;新能源汽车产业正经历结构性变革。国际清洁交通委员会&#xff08;ICCT&#xff09;最新报告显示&#xff0c;2023年全球新能源汽车渗透率突破18%&#xff0c;中国市场以42%的市占率持续领跑。这种产业变革正沿着&q…...

系统重装——联想sharkbay主板电脑

上周给一台老电脑重装系统系统&#xff0c;型号是lenovo sharkbay主板的电脑&#xff0c;趁着最近固态便宜&#xff0c;入手了两块长城的固态&#xff0c;装上以后插上启动U盘&#xff0c;死活进不去boot系统。提示 bootmgr 缺失&#xff0c;上网查了许久&#xff0c;终于解决了…...

CentOS 7.9升级OpenSSH到9.9p2

初始版本 ssh -V OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017 1.安装编译依赖 yum install -y gcc perl make zlib-devel pam-devel openssl-devel wget 2.升级OpenSSL到1.1.1版本 2.1 备份当前OpenSSL配置 sudo cp -r /usr/bin/openssl /usr/bin/openssl.bak sudo …...

fastjson使用parseObject转换成JSONObject出现将字符特殊字符解析解决

现象&#xff1a;将字符串的${TARGET_VALUE}转换成NULL字符串了问题代码&#xff1a; import com.alibaba.fastjson.JSON;JSONObject config JSON.parseObject(o.toString()); 解决方法&#xff1a; 1.更换fastjson版本 import com.alibaba.fastjson2.JSON;或者使用其他JS…...

37、aiomysql实操习题

练习题1&#xff1a;慢查询优化 题目描述 将以下低效查询优化为索引查询&#xff1a; # 原始低效查询 await cursor.execute("SELECT * FROM orders WHERE YEAR(created_at)2023")参考答案 # 优化后查询&#xff08;使用索引范围扫描&#xff09; await cursor.e…...

Rust 2025:内存安全革命与异步编程新纪元

Rust 2025 Edition通过区域内存管理、泛型关联类型和零成本异步框架三大革新&#xff0c;重新定义系统级编程语言的能力边界。本次升级不仅将内存安全验证效率提升80%&#xff0c;更通过异步执行器架构优化实现微秒级任务切换。本文从编译器原理、运行时机制、编程范式转型三个…...

【安装neo4j-5.26.5社区版 完整过程】

1. 安装java 下载 JDK21-windows官网地址 配置环境变量 在底下的系统变量中新建系统变量&#xff0c;变量名为JAVA_HOME21&#xff0c;变量值为JDK文件夹路径&#xff0c;默认为&#xff1a; C:\Program Files\Java\jdk-21然后在用户变量的Path中&#xff0c;添加下面两个&am…...

开关电源实战(六)STM32数控电源BuckBoost

文章目录 芯片手册详解栅极驱动器EG3112栅极驱动芯片2EDF7275K隔离式MOS栅极驱动器运放检测电流GS8558MCP6022打板测试硬件设计PID测试存在的问题参考:基于STM32的同步整流Buck-Boost数字电源 开源 芯片手册详解 栅极驱动器 EG3112栅极驱动芯片 (较低芯片,一个四五毛) …...

Vue3项目中 npm 依赖安装 --save 与 --save-dev 的区别解析

这两个命令的区别如下&#xff1a; bash npm install --save types/crypto-js # 安装到 dependencies&#xff08;生产依赖&#xff09; npm install --save-dev types/crypto-js # 安装到 devDependencies&#xff08;开发依赖&#xff09; 核心区别 依赖分类不同…...

Oracle 数据库中的 JSON:性能注意事项

本文为白皮书“JSON in Oracle Database: Performance Considerations”的翻译及阅读笔记。 目的 本文档概述了在 Oracle 数据库中存储和处理的 JavaScript 对象表示法 (JSON) 的性能调优最佳实践。应用这些最佳实践将使开发人员、数据库管理员和架构师能够主动避免性能问题&…...

机器人项目管理新风口:如何高效推动智能机器人研发?

在2025年政府工作报告中&#xff0c;“智能机器人”首次被正式纳入国家发展战略关键词。从蛇年春晚的秧歌舞机器人惊艳亮相&#xff0c;到全球首个人形机器人马拉松的热议&#xff0c;智能机器人不仅成为科技前沿的焦点&#xff0c;也为产业升级注入了新动能。而在热潮背后&…...

【Linux】网络基础和socket(4)

1.网络通信&#xff08;app\浏览器、小程序&#xff09; 2.网络通信三要素&#xff1a; IP&#xff1a;计算机在网络上唯一标识&#xff08;ipv4:4个字段&#xff0c;每段最大255 IPV6:16进制&#xff09; 端口&#xff1a;计算机应用或服务唯一标识 ssh提供远程安全连接…...

大数据可能出现的bug之flume

一、vi /software/flume/conf/dir_to_logger.conf配置文件 问题的关键: Dir的D写成了小写 另一个终端里面的东西一直在监听状态下无法显示 原来是vi /software/flume/conf/dir_to_logger.conf里面的配置文件写错了 所以说不是没有source参数的第三行的原因 跟这个没关系 …...

图解Mysql原理之全局锁,表级锁,行锁了解吗?

前言 大家好&#xff0c;我是程序蛇玩编程。 Mysql中的锁大家都用过吗&#xff0c;那全局锁&#xff0c;表锁&#xff0c;行锁哪个用的频率最多呢? 正文 全局锁: 全局锁就是对整个数据库实例加锁。 MySQL 提供了一个加全局读锁的方法&#xff0c;命令是 Flush tables wi…...