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.rhkb.cn/news/228638.html

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

相关文章

Django 学习教程- Django模板(Template)

系列 Django 学习教程-介绍与安装-CSDN博客 Django 学习教程- Hello world入门案例-CSDN博客 前言 在上一章节中我们使用django.http.HttpResponse() 来输出 "Hello World!"。该方式将数据与视图混合在一起,不符合 Django 的 MTV 思想。 本…

node 项目中 __dirname / __filename 是什么,为什么有时候不能用?

__dirname 是 Node.js 中的一个特殊变量,表示当前执行脚本所在的目录的绝对路径。 __filename 同理,是 Node.js 中的一个特殊变量,表示当前执行脚本的绝对路径,包括文件名。 在 Node.js 中,__dirname / __filename是…

Primavera Unifier 项目控制延伸:Phase Gate理论:2/3

阶段Gate的具体内容: 阶段0 根据公司需要和资源现状,决定开展哪些项目。在这个阶段,公司一般需要开展一些脑力风暴或者团队集思广益的活动以获得足够多的点子。一旦团队决定采用某个想法,必须从各个维度去完善它,并使…

Linux服务器搭建笔记-006:拓展/home目录容量

一、问题说明 Ubuntu服务器在使用过程中创建的新用户,每位用户会在/home目录下生成一个属于其个人的主文件夹。如果不限制各个用户的使用空间,所有的用户都会共用/home所挂载的硬盘。在这种多用户情况下,会很快的填满/home目录,导…

B2005 字符三角形(python)

a input() print( a) print( a a a) print(a a a a a)python中默认输入的是字符型,第一句就是输入了一个字符赋给a python中单引号内的也是字符串,用print输出需要连接的字符串时用加号加在后面即可

HarmonyOS应用开发-搭建开发环境

本文介绍如何搭建 HarmonyOS 应用的开发环境,介绍下载安装 DevEco Studio 开发工具和 SDK 的详细流程。华为鸿蒙 DevEco Studio 是面向全场景的一站式集成开发环境,面向全场景多设备,提供一站式的分布式应用开发平台,支持分布式多…

2024年人工智能领域10大预测

2023年人工智能领域如果只能筛选一个关键词的话,恐怕非“大模型”莫属。大模型的发展在过去一年中,让各行各业发生了天翻地覆的变化,有企业因大模型而新生,有企业因大模型而消亡。企业的变迁跟技术迭代息息相关,而大模…

C# MVC +Layui侧边导航栏的收缩及展开

目录 1、头部代码 2、侧边栏&#xff08;例子只写了一级导航&#xff0c;需要多级可自行添加&#xff09; 3、body内容填充 4、 JS 1、头部代码 <div class"layui-layout layui-layout-admin"> <div class"layui-header"> …

27 UVM queue

uvm_queue类构建一个动态队列&#xff0c;该队列将按需分配并通过引用传递。 uvm_queue类声明&#xff1a; class uvm_queue #( type T int ) extends uvm_object 1 uvm_queue class hierarchy 2 uvm_queue class Methods 3 UVM Queue Example 在下面的示例中&#xff0c;…

MySQL 数值函数,字符串函数与多表查询

MySQL像其他语言一样,也提供了很多库函数,分为单行函数和分组函数(聚合函数),我们这里先简易介绍一些函数,熟悉就行,知道怎么使用即可. 数值函数 三角函数 指数与对数函数 进制间的转换函数 字符串函数 注:LPAD函数是右对齐,RPAD函数是左对齐 多表查询 注:如果为表起了别名,就…

easyx的窗口函数

文章目录 前言一、EasyX的颜色二、EasyX的坐标和设备1&#xff0c;EasyX的坐标2&#xff0c;EasyX的设备 三、窗口函数1&#xff0c;初始化窗口函数2&#xff0c;关闭绘图窗口3&#xff0c;设置窗口背景板颜色4&#xff0c;清空绘图设备 前言 easyx是针对c的图形库&#xff0c;…

[ffmpeg系列 02] 音视频基本知识

一 视频 RGB&#xff1a; AV_PIX_FMT_RGB24, ///< packed RGB 8:8:8, 24bpp, RGBRGB… Y&#xff1a;明亮度, Luminance或luma, 灰阶图&#xff0c; UV&#xff1a;色度&#xff0c;Chrominance或Chroma。 YCbCr: Cb蓝色分量&#xff0c;Cr是红色分量。 取值范围&#xff…

判断电话号码是否重复-excel

有时候重复的数据不需要或者很烦人&#xff0c;就需要采取措施&#xff0c;希望以下的方法能帮到你。 1.判断是否重复 方法一&#xff1a; 1&#xff09;针对第一个单元格输入等号&#xff0c;以及公式countif(查找记录数的范围&#xff0c;需要查找的单元格&#xff09; 2…

网络编程『简易TCP网络程序』

&#x1f52d;个人主页&#xff1a; 北 海 &#x1f6dc;所属专栏&#xff1a; Linux学习之旅、神奇的网络世界 &#x1f4bb;操作环境&#xff1a; CentOS 7.6 阿里云远程服务器 文章目录 &#x1f324;️前言&#x1f326;️正文TCP网络程序1.字符串回响1.1.核心功能1.2.程序…

AIGC开发:调用openai的API接口实现简单机器人

简介 开始进行最简单的使用&#xff1a;通过API调用openai的模型能力 OpenAI的能力如下图&#xff1a; 文本生成模型 OpenAI 的文本生成模型&#xff08;通常称为生成式预训练 Transformer 或大型语言模型&#xff09;经过训练可以理解自然语言、代码和图像。这些模型提供文…

logstash收集华为、H3C、Cisco交换机日志

网络设备配置 将 syslog-ip 替换成服务器的IP地址。 Huawei info-center loghost source interface info-center loghost syslog-ip local-time facility local6 H3C info-center loghost source interface info-center loghost syslog-ip facility local5 Aruba logging arm …

上市公司企业战略激进度2004-2022市场扩张创新倾向成长性生产效率组织结构稳定性资本密度防御分析进攻型

上市公司企业战略激进度2004-2022市场扩张创新倾向成长性生产效率组织结构稳定性资本密度防御分析进攻型有原始数据、详细代码、计算结果&#xff01;数据来源&#xff1a;基于上市公司公告数据整理计算 数据范围&#xff1a;沪深北证A股上市公司【2023新数据】上市公司企业战略…

linux cat命令增加-f显示文件名功能

在使用cat命令配合grep批量搜索文件内容时&#xff0c;我仅仅能知道是否搜索到&#xff0c;不知道是在哪个文件里找到的。比如cat ./src/*.c | grep full_write,在src目录下的所有.c文件里找full_write,能匹配到所有的full_write&#xff0c;但是不知道它们分别在哪些文件里。于…

「微服务」微服务架构中的数据一致性

在微服务中&#xff0c;一个逻辑上原子操作可以经常跨越多个微服务。即使是单片系统也可能使用多个数据库或消息传递解决方案。使用多个独立的数据存储解决方案&#xff0c;如果其中一个分布式流程参与者出现故障&#xff0c;我们就会面临数据不一致的风险 - 例如在未下订单的情…

进程互斥的软件实现方法-第二十六天

目录 前言 单标志法&#xff08;谦让&#xff09; 双标志先检查法&#xff08;表达意愿&#xff09; 双标志后检查法&#xff08;表达意愿&#xff09; Peterson算法&#xff08;集大成者&#xff09; 本节思维导图 前言 单标志法、双标志的先后检查法中&#xff0c;如果…