unknown variable ‘authentication_policy=mysql_native_password‘

unknown variable 'authentication_policy=mysql_native_password'

  • 背景
  • 解决
    • 尝试一
    • 尝试二(解决)
  • 总结

背景

mac上安装多个版本数据库。我是通过dmg安装的,先装的5.7,再装的5.8,然后5.8的能正常用,5.7的启动不起来。报错信息为如下

2023-12-27T11:50:43.479739Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2023-12-27T11:50:43.479980Z 0 [Warning] Insecure configuration for --secure-file-priv: Current value does not restrict location of generated files. Consider setting it to a valid, non-empty path.
2023-12-27T11:50:43.480218Z 0 [Note] /usr/local/mysql/bin/mysqld (mysqld 5.7.12) starting as process 90928 ...
2023-12-27T11:50:43.481832Z 0 [Warning] Setting lower_case_table_names=2 because file system for /usr/local/mysql/data/ is case insensitive
2023-12-27T11:50:43.483414Z 0 [Warning] You need to use --log-bin to make --binlog-format work.
2023-12-27T11:50:43.486307Z 0 [ERROR] Plugin keyring_file reported: 'keyring_file initialization failure. Please check if the keyring_file_data points to readable keyring file or keyring file can be created in the specified location. The keyring_file will stay unusable until correct path to the keyring file gets provided'
2023-12-27T11:50:43.486907Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2023-12-27T11:50:43.486915Z 0 [Note] InnoDB: Uses event mutexes
2023-12-27T11:50:43.486919Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2023-12-27T11:50:43.486923Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3
2023-12-27T11:50:43.487938Z 0 [Note] InnoDB: Number of pools: 1
2023-12-27T11:50:43.487999Z 0 [Note] InnoDB: Using CPU crc32 instructions
2023-12-27T11:50:43.662577Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2023-12-27T11:50:43.667975Z 0 [Note] InnoDB: Completed initialization of buffer pool
2023-12-27T11:50:43.682914Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2023-12-27T11:50:43.688889Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2023-12-27T11:50:43.689059Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2023-12-27T11:50:43.692481Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2023-12-27T11:50:43.692851Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2023-12-27T11:50:43.692857Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2023-12-27T11:50:43.693045Z 0 [Note] InnoDB: Waiting for purge to start
2023-12-27T11:50:43.748088Z 0 [Note] InnoDB: 5.7.12 started; log sequence number 2527696
2023-12-27T11:50:43.748195Z 0 [Note] InnoDB: Loading buffer pool(s) from /usr/local/mysql-5.7/data/ib_buffer_pool
2023-12-27T11:50:43.748427Z 0 [Note] Plugin 'FEDERATED' is disabled.
2023-12-27T11:50:43.748994Z 0 [Note] InnoDB: Buffer pool(s) load completed at 231227 19:50:43
2023-12-27T11:50:43.749371Z 0 [ERROR] unknown variable 'authentication_policy=mysql_native_password'
2023-12-27T11:50:43.749381Z 0 [ERROR] Aborting2023-12-27T11:50:43.749392Z 0 [Note] Binlog end
2023-12-27T11:50:43.749429Z 0 [Note] Shutting down plugin 'ngram'
2023-12-27T11:50:43.749437Z 0 [Note] Shutting down plugin 'partition'
2023-12-27T11:50:43.749443Z 0 [Note] Shutting down plugin 'BLACKHOLE'
2023-12-27T11:50:43.749449Z 0 [Note] Shutting down plugin 'ARCHIVE'
2023-12-27T11:50:43.749454Z 0 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
2023-12-27T11:50:43.749481Z 0 [Note] Shutting down plugin 'MRG_MYISAM'
2023-12-27T11:50:43.749488Z 0 [Note] Shutting down plugin 'MyISAM'
2023-12-27T11:50:43.749499Z 0 [Note] Shutting down plugin 'INNODB_SYS_VIRTUAL'
2023-12-27T11:50:43.749505Z 0 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'
2023-12-27T11:50:43.749510Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES'
2023-12-27T11:50:43.749515Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'
2023-12-27T11:50:43.749519Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'
2023-12-27T11:50:43.749524Z 0 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'
2023-12-27T11:50:43.749529Z 0 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'
2023-12-27T11:50:43.749533Z 0 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'
2023-12-27T11:50:43.749538Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'
2023-12-27T11:50:43.749544Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLES'
2023-12-27T11:50:43.749548Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'
2023-12-27T11:50:43.749554Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'
2023-12-27T11:50:43.749559Z 0 [Note] Shutting down plugin 'INNODB_FT_CONFIG'
2023-12-27T11:50:43.749565Z 0 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'
2023-12-27T11:50:43.749571Z 0 [Note] Shutting down plugin 'INNODB_FT_DELETED'
2023-12-27T11:50:43.749577Z 0 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'
2023-12-27T11:50:43.749581Z 0 [Note] Shutting down plugin 'INNODB_METRICS'
2023-12-27T11:50:43.749585Z 0 [Note] Shutting down plugin 'INNODB_TEMP_TABLE_INFO'
2023-12-27T11:50:43.749589Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'
2023-12-27T11:50:43.749592Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'
2023-12-27T11:50:43.749596Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'
2023-12-27T11:50:43.749599Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'
2023-12-27T11:50:43.749603Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX'
2023-12-27T11:50:43.749607Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'
2023-12-27T11:50:43.749610Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM'
2023-12-27T11:50:43.749614Z 0 [Note] Shutting down plugin 'INNODB_CMP_RESET'
2023-12-27T11:50:43.749617Z 0 [Note] Shutting down plugin 'INNODB_CMP'
2023-12-27T11:50:43.749621Z 0 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'
2023-12-27T11:50:43.749625Z 0 [Note] Shutting down plugin 'INNODB_LOCKS'
2023-12-27T11:50:43.749628Z 0 [Note] Shutting down plugin 'INNODB_TRX'
2023-12-27T11:50:43.749632Z 0 [Note] Shutting down plugin 'InnoDB'
2023-12-27T11:50:43.749719Z 0 [Note] InnoDB: FTS optimize thread exiting.
2023-12-27T11:50:43.749747Z 0 [Note] InnoDB: Starting shutdown...
2023-12-27T11:50:43.855004Z 0 [Note] InnoDB: Dumping buffer pool(s) to /usr/local/mysql-5.7/data/ib_buffer_pool
2023-12-27T11:50:43.856040Z 0 [Note] InnoDB: Buffer pool(s) dump completed at 231227 19:50:43
2023-12-27T11:50:45.229428Z 0 [Note] InnoDB: Shutdown completed; log sequence number 2527715
2023-12-27T11:50:45.230046Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2023-12-27T11:50:45.230082Z 0 [Note] Shutting down plugin 'MEMORY'
2023-12-27T11:50:45.230103Z 0 [Note] Shutting down plugin 'CSV'
2023-12-27T11:50:45.230116Z 0 [Note] Shutting down plugin 'sha256_password'
2023-12-27T11:50:45.230127Z 0 [Note] Shutting down plugin 'mysql_native_password'
2023-12-27T11:50:45.230136Z 0 [Note] Shutting down plugin 'keyring_file'
2023-12-27T11:50:45.233646Z 0 [Note] Shutting down plugin 'binlog'
2023-12-27T11:50:45.233996Z 0 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete

解决

报错信息主要有两个:

  • keyring_file
  • authentication_policy=mysql_native_password
    第一个感觉不是很关键,因为报错了程序还是继续往下在走。第二个的话,查了一下说是配置错误,这个配置是8.0的,5.7的识别不了。

尝试一

既然识别不了,把配置改了不就行了。但是又有一个问题,用的是默认配置,只能新建配置进行覆写。

在这里插入图片描述

这里可以看到,也有keyring的路径,这次我没处理它,但是在对应路径下创建了文件。然后手动创建了启动配置,然后设置了对应的目录,这里注意需要apply一下。

但是呢,再次重启还是失败,keyring的问题没有修复,指定的配置文件也没有生效。。服务一直处于运行中 》 暂停 》运行中的死循环。突发奇想,ps了一下,发现有惊喜。。。

在这里插入图片描述

理解没啥问题,配置实际也读取到了,但是最后它又加了奇奇怪怪的一些配置,然后其中就有导致我们出错的命令authentication_policy=mysql_native_password。那么,问题来了,这东西是哪里来的呢?

尝试二(解决)

查了一些资料,说是一般在/Library/LaunchDaemons目录下,我进去看了一眼,过滤了一下,发现的确有它。

在这里插入图片描述

看了一下文件内容,找到了!

在这里插入图片描述

后面就是把那一行注了,然后把之前指定的配置文件和keyring配置关了

在这里插入图片描述

再次尝试重启,启动成功了!

2023-12-27T11:56:09.333257Z 0 [ERROR] kevent failed with errno= 9,exiting timer notifier thread.
2023-12-27T11:56:09.610993Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2023-12-27T11:56:09.611244Z 0 [Warning] Insecure configuration for --secure-file-priv: Current value does not restrict location of generated files. Consider setting it to a valid, non-empty path.
2023-12-27T11:56:09.611509Z 0 [Note] /usr/local/mysql/bin/mysqld (mysqld 5.7.12) starting as process 92465 ...
2023-12-27T11:56:09.613531Z 0 [Warning] Setting lower_case_table_names=2 because file system for /usr/local/mysql/data/ is case insensitive
2023-12-27T11:56:09.615096Z 0 [Warning] You need to use --log-bin to make --binlog-format work.
2023-12-27T11:56:09.616205Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2023-12-27T11:56:09.616218Z 0 [Note] InnoDB: Uses event mutexes
2023-12-27T11:56:09.616223Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2023-12-27T11:56:09.616227Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3
2023-12-27T11:56:09.617303Z 0 [Note] InnoDB: Number of pools: 1
2023-12-27T11:56:09.617372Z 0 [Note] InnoDB: Using CPU crc32 instructions
2023-12-27T11:56:09.809280Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2023-12-27T11:56:09.815378Z 0 [Note] InnoDB: Completed initialization of buffer pool
2023-12-27T11:56:09.830516Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2023-12-27T11:56:09.837315Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2023-12-27T11:56:09.837470Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2023-12-27T11:56:09.841482Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2023-12-27T11:56:09.841870Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2023-12-27T11:56:09.841876Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2023-12-27T11:56:09.842056Z 0 [Note] InnoDB: Waiting for purge to start
2023-12-27T11:56:09.897098Z 0 [Note] InnoDB: 5.7.12 started; log sequence number 2528355
2023-12-27T11:56:09.897213Z 0 [Note] InnoDB: Loading buffer pool(s) from /usr/local/mysql-5.7/data/ib_buffer_pool
2023-12-27T11:56:09.897499Z 0 [Note] Plugin 'FEDERATED' is disabled.
2023-12-27T11:56:09.897755Z 0 [Note] InnoDB: Buffer pool(s) load completed at 231227 19:56:09
2023-12-27T11:56:09.902571Z 0 [Warning] Failed to set up SSL because of the following SSL library error: SSL context is not usable without certificate and private key
2023-12-27T11:56:09.902581Z 0 [Note] Server hostname (bind-address): '127.0.0.1'; port: 3306
2023-12-27T11:56:09.902757Z 0 [Note]   - '127.0.0.1' resolves to '127.0.0.1';
2023-12-27T11:56:09.902809Z 0 [Note] Server socket created on IP: '127.0.0.1'.
2023-12-27T11:56:09.934502Z 0 [Note] Event Scheduler: Loaded 0 events
2023-12-27T11:56:09.934584Z 0 [Note] /usr/local/mysql/bin/mysqld: ready for connections.
Version: '5.7.12'  socket: '/tmp/mysql.sock'  port: 3306  MySQL Community Server (GPL)

总结

碰到问题还是看看日志吧,一般都会记录原因。一开始我先是以为版本问题,换了一个5.7的版本,试了一下没用。然后百度、google查资料,也没找到线索。。最后还是得自己分析。。。

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

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

相关文章

Python五子棋程序实现详解

Python五子棋程序实现详解 引言功能实现显示棋盘点击落子判断胜负游戏结束判断交替落子 运行结果完整代码总结 引言 五子棋是一种广泛传播的策略棋类游戏,两人对弈,通过在棋盘上落子,以先形成连续的相同颜色的五子棋为胜利条件。本文将介绍如…

生存分析序章2——生存分析之Python篇:lifelines库入门

目录 写在开头1. 介绍 lifelines 库1.1 lifelines库简介1.2 安装与环境配置 2. 数据准备2.1 数据格式与结构2.2 处理缺失数据2.3 对异常值的处理 3. Kaplan-Meier 曲线3.1 使用 lifelines 绘制生存曲线3.2 曲线解读3.3 额外补充 4. Cox 比例风险模型4.1 lifelines 中的 Cox 模型…

7+非肿瘤+线粒体+PPI+机器学习+实验,多套路搭配干湿结合

今天给同学们分享一篇生信文章“Identification of mitochondrial related signature associated with immune microenvironment in Alzheimers disease”,这篇文章发表在J Transl Med期刊上,影响因子为7.4。 结果解读: 在ND和AD样本中鉴定差…

vscode调用HTML文件

vscode实现对HTML文件调用 创建html文件下载拓展内容点击拓展查找需要的拓展 导入html代码设置默认打开浏览器运行结果参考文献 做数据库课设的内容,尝试一些自己没有接触过的东西,了解如何创建一个网站以及数据库的一个应用 创建html文件 创建一个html的文件,加入后缀名 下…

Hive04_DDL操作

Hive DDL操作 1 DDL 数据定义 1.1 创建数据库 CREATE DATABASE [IF NOT EXISTS] database_name [COMMENT database_comment] [LOCATION hdfs_path] [WITH DBPROPERTIES (property_nameproperty_value, ...)];[IF NOT EXISTS] :判断是否存在 [COMMENT database_c…

procise纯PL流程点灯记录

procise纯PL流程点灯记录 一、概述 此篇记录使用procise工具构造JFMQL15T 纯PL工程,显示PL_LED闪烁; 硬件说明如下: 时钟引脚 Pl_CLK: U2 ,IO_L14P_T2_SRCC_34 PL_LED1 : E2, IO_L17P_T2_AD5P_35 PL_LED2: D6, IO_L2N_T0_AD8N_35 PL_LED3 :…

.NET CORE 无法调试 当前不会命中断点

多个项目直接可以设置项目的属性->生成->输出的配置文件输出地址 然后路径统一输入该项目的bib/debug/.netcorex.x就可以了

【JAVA】黑马MybatisPlus 学习笔记【终】【插件功能】

4.插件功能 MybatisPlus提供了很多的插件功能,进一步拓展其功能。目前已有的插件有: PaginationInnerInterceptor:自动分页TenantLineInnerInterceptor:多租户DynamicTableNameInnerInterceptor:动态表名OptimisticL…

【Linux】生产者消费者模型(阻塞队列与环形队列)和POSIX信号量

文章目录 一、生产者消费者模型二、基于BlockingQueue的生产者消费者模型1.BlockQueue.hpp2.Task.hpp3.main.cc 三、POSIX信号量四、基于环形队列的生产消费模型1.RingQueue.hpp2.Task.hpp3.main.cc 一、生产者消费者模型 我们这里举一个例子,来解释生产者消费者模…

【数据结构和算法】寻找数组的中心下标

其他系列文章导航 Java基础合集数据结构与算法合集 设计模式合集 多线程合集 分布式合集 ES合集 文章目录 其他系列文章导航 文章目录 前言 一、题目描述 二、题解 2.1 前缀和的解题模板 2.1.1 最长递增子序列长度 2.1.2 寻找数组中第 k 大的元素 2.1.3 最长公共子序列…

雷盛红酒和云仓酒庄的优势

多国家采购、多葡萄酒品种、多价位区间的全系列整体品牌形式的雷盛(LEESON)红酒云仓酒庄,具有以下优势: 1.明星代言。雷盛(LEESON)品牌系列葡萄酒有幸邀请著名导演张纪中先生担任品牌代言人,为…

什么是天线OTA,怎么通过OTA数据评估产品射频环境情况

1.1 验证项目 产品的器件布局、走线是否合理、电源输入输出设计、纹波控制,铺地回流设计等是否合理. 通过验证产品的天线OTA_TIS项目来作为评估当前的设计是否合理之一,重点验证低频部分,如Band8段数据. 1.2 什么是天线OTA 是指某无线产品…

Vue3使用的Compostion Api和Vue2使用的Options Api有什么不同?

我们介绍Compostion Api和Options Api的区别之前,先来说一下为什么会推出来Composition Api,解决了什么问题? Vue2开发项目使用Options Api存在的问题 代码的可读性和维护性随着组件的变大业务的增多而变得差代码的共享和重用性存在缺点不支…

【Linux】进程查看|fork函数|进程状态

🦄 个人主页——🎐开着拖拉机回家_Linux,大数据运维-CSDN博客 🎐✨🍁 🪁🍁🪁🍁🪁🍁🪁🍁 🪁🍁🪁&am…

H.264宏块(Macroblock)概念(运动估计、变换编码、环路滤波)

参考文章:音视频高手课系列5-h264编码基础(宏块原理) 参考文章:切片slice与宏块,运动矢量 文章目录 使用videoEye分析视频宏块示例H.264宏块概念1. 宏块的定义2. 运动估计3. 变换编码4. 环路滤波5. 注意:宏块的概念既适用于帧内编…

基于Java Swing的图书管理系统

一、项目总体架构 本项目基于Java Swing框架,数据库采用的是MySQL。项目文件夹如下: 二、项目截图 1.登录和注册界面 2.用户界面 3.管理员管理图书类别 4.管理员管理书籍 5.管理员管理用户 项目总体包括源代码和课程论文,需要源码的…

通过MobaXterm远程连接Anolis

目录 前言: 一.设置ip 二.远程连接 前言: 小编已经阐述了如何安装Anolis系统,如果有不了解的小伙伴可以查看这一篇博客Anolis安装 这篇博客将会讲述如何远程连接Anolis系统。各位看官拿好板凳! 一.设置ip 打开网卡所在位…

西门子PLC通过PROFINET协议与多功能电表通讯

西门子PLC通过PROFINET协议与多功能电表通讯 项目要求 西门子S71200PLC需要通过PROFINET协议和多功能电表通讯,读取线电压、相电压、线电流、相电流、有功功率、无功功率等参数。 项目实施 采用网关NET90-PN-MBT(以下简称“网关”)&#…

怎么提取视频中的背景音乐?

当我们在刷视频的时候,有时候听到一个背景音乐很好听,但是又不知道歌名,比如英语歌,这个时候我们很难找到这首歌,相信有很多朋友会遇到这样的问题,不知道怎么弄,下面小编给大家推荐一些方法帮助…

Pytorch从零开始实战14

Pytorch从零开始实战——DenseNet SENet算法实战 本系列来源于365天深度学习训练营 原作者K同学 文章目录 Pytorch从零开始实战——DenseNet SENet算法实战环境准备数据集模型选择开始训练可视化总结 环境准备 本文基于Jupyter notebook,使用Python3.8&#x…