mysql安装程序是未知文件,MySQL:未知变量,无法运行任何MySQL应用程序,与my.cnf无关...

本文解决了一个在Fedora上运行MySQL时遇到的问题,当尝试启动MySQL服务时出现未知变量错误。通过对初始化文件进行调整并确保使用正确的配置文件路径,最终解决了问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

My problem is that, when trying to run MYSQL on Fedora, I am faced with the following error:

mysql: unknown variable 'max_connections=40'

It does the exact same thing for any other of the commands, such as mysqldump, mysqlcheck etc etc

The my.cnf file reads the following, though I've renamed it and the error still occurs. It almost seems like it's a system variable that I am unable to edit without running mysql, thus the catch 22!

[mysqld]

datadir=/var/lib/mysql

socket=/var/lib/mysql/mysql.sock

user=mysql

# Disabling symbolic-links is recommended to prevent assorted security risks

symbolic-links=0

[mysqld_safe]

log-error=/var/log/mysqld.log

pid-file=/var/run/mysqld/mysqld.pid

I've also of course checked the system for any other my.cnf files.

I'm really lost and starting to tear my hair out. Any help would be greatly appreciated! :)

Thanks

Matt

解决方案

assuming that your good configuration file is /etc/my.cnf (which may not be), edit your mysql init file and add --init-file /etc/my.cnf to the mysqld command to make sure that it is indeed reading from the the init file that you think it is reading from.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值