arch mysql日志位置_【笔记】Archlinux下配置rsyslog写日志到mysql

1、archlinux的rsyslog不在官方包里面 需要用yay在社区下载

2、先配置数据库

CREATE DATABASE Syslog;

USE Syslog;

CREATE TABLE SystemEvents

(

ID int unsigned not null auto_increment primary key,

CustomerID bigint,

ReceivedAt datetime NULL,

DeviceReportedTime datetime NULL,

Facility smallint NULL,

Priority smallint NULL,

FromHost varchar(60) NULL,

Message text,

NTSeverity int NULL,

Importance int NULL,

EventSource varchar(60),

EventUser varchar(60) NULL,

EventCategory int NULL,

EventID int NULL,

EventBinaryData text NULL,

MaxAvailable int NULL,

CurrUsage int NULL,

MinUsage int NULL,

MaxUsage int NULL,

InfoUnitID int NULL ,

SysLogTag varchar(60),

EventLogType varchar(60),

GenericFileName VarChar(60),

SystemID int NULL

);

CREATE TABLE SystemEventsProperties

(

ID int unsigned not null auto_increment primary key,

SystemEventID int NULL ,

ParamName varchar(255) NULL ,

ParamValue text NULL

);

数据库名和下面的配置一致就好 但是表明和表结构是定死的 不能改

3、创建用户并赋予权限

create user sys_用户名@'localhost' identified by '用户密码';

grant all privileges on Syslog.* to 用户名@'localhost';

4、编辑/etc/rsyslog.conf 在最上面加上两行

$Modload ommysql

*.* :ommysql:数据库地址,数据库名称,用户名,密码

5、重启rsyslog服务 查看服务状态 如果报错action 'action-0-ommysql' (module 'ommysql') message lost, could not be processed

刷新数据库权限 flush privileges

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
STM32F103C8T6是一款基于ARM Cortex-M3架构的微控制器,如果你想要配置Makefile以支持ARMv7E-M (Cortex-M4)体系结构,你需要在Makefile中设置一些特定的变量和选项。以下是配置示例: 1. 首先,在Makefile顶部,添加对`ARM_TOOLCHAIN_PATH`的指定,这个路径通常包含ARM编译工具链,例如gcc-arm-none-eabi: ```makefile ARM_TOOLCHAIN_PATH = /path/to/arm-none-eabi-gcc ``` 2. 然后,你可以设置`ARCH`和`CPU`变量,告诉Makefile你正在使用的处理器架构: ```makefile ARCH := arm7em CPU := cortex-m4 ``` 3. 使用`$(MAKECMDGOALS)`判断是否需要编译Cortex-M4相关的代码,因为默认情况下可能会针对所有目标,包括其他内核版本: ```makefile ifneq ($(findstring $(MAKECMDGOAL),clean),) ifeq ($(findstring cortex-m4,$(CPU)),cortex-m4) export STM32_F4XX_BASE := $(shell $(ARM_TOOLCHAIN_PATH)/bin/arm-none-eabi-gcc -dumpmachine | sed 's/-.*//') endif endif ``` 4. 接下来,在编译规则部分,使用这些变量选择正确的库和编译选项: ```makefile CFLAGS += -mcpu=$(CPU) -mthumb -march=$(ARCH) -mfpu=fpv4-sp-d16 -ffunction-sections -fdata-sections LDFLAGS += -mcpu=$(CPU) -mthumb -march=$(ARCH) -Wl,--gc-sections ``` 5. 如果你在使用Keil MDK等IDE,那么可能还需要相应的宏定义和项目设置。 记得替换`/path/to/arm-none-eabi-gcc`为你实际的ARM工具链路径。完成上述设置后,你应该能针对STM32F103C8T6的Cortex-M4内核编译程序了。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值