简体   繁体   English

如何修复“无法打开所需的默认文件:/usr/local/ampps/mysql/etc/my.cnf”错误?

[英]How to fix "Could not open required defaults file: /usr/local/ampps/mysql/etc/my.cnf" error?

When I'm try to run: sudo service mysqld start I get the following error:当我尝试运行时: sudo service mysqld start 我收到以下错误:

Could not open required defaults file: /usr/local/ampps/mysql/etc/my.cnf Fatal error in defaults handling.无法打开所需的默认文件:/usr/local/ampps/mysql/etc/my.cnf 默认处理中的致命错误。 Program aborted程序中止
Starting MySQL.The server quit without updating PID file(/[FAILED]l/ampps/var/mysqld.pid).启动 MySQL。服务器退出而不更新 PID 文件 (/[FAILED]l/ampps/var/mysqld.pid)。

I've tried to check if the my.cnf exists or not, and It exits.我试图检查 my.cnf 是否存在,并且它退出了。

I also had this problem in Artix Linux, to solve it just create the file my.cnf with the following content:我在 Artix Linux 中也遇到了这个问题,要解决它,只需使用以下内容创建文件my.cnf

[mysqld]
basedir=/usr
datadir=/var/lib/mysql
user=mysql
pid-file=/run/mysqld/mysqld.pid

After that I was able to run the mysqld service.之后我就可以运行mysqld服务了。 I don't know in fedora where you have to create it, in my case was inside the directory /etc/mysql but in your case I guess it would be inside /usr/local/ampps/mysql/etc .我不知道在 Fedora 中你必须在哪里创建它,在我的情况下是在目录/etc/mysql但在你的情况下我想它会在/usr/local/ampps/mysql/etc Hope that helps.希望有帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何修复:mysql:[错误] 在配置文件 /etc/mysql/my.cnf 中找到没有前面组的选项? - How to fix: mysql: [ERROR] Found option without preceding group in config file /etc/mysql/my.cnf? 如何将 mysql 默认文件 (my.cnf) 与 sqlalchemy 一起使用? - how to use mysql defaults file (my.cnf) with sqlalchemy? Automysqlbackup - 无法打开所需的默认文件:/etc/mysql/debian.cnf - Automysqlbackup - Could not open required defaults file: /etc/mysql/debian.cnf 在我的目录中看不到/etc/my.cnf /etc/mysql/my.cnf /usr/etc/my.cnf〜/ .my.cnf中的任何一个 - Cannot see any of /etc/my.cnf /etc/mysql/my.cnf /usr/etc/my.cnf ~/.my.cnf in my dir MySQL 5.5.38没有从/usr/etc/my.cnf中选择选项文件 - MySQL 5.5.38 not picking option file from /usr/etc/my.cnf 无法创建本地数据库,因为错误:文件/etc/my.cnf 不存在 - cant make local database because Error: FIle/etc/my.cnf doesnt exist 我无法更改以及如何打开 /etc/my.cnf - i cannot change and how to open /etc/my.cnf 如何在etc/my.cnf中增加Mysql Connection限制 - How to increase the Mysql Connection limit in etc/my.cnf 如何为不同的mysql版本分隔/etc/my.cnf - How to separate /etc/my.cnf for different mysql versions 如何重新启动mysql以及my.cnf文件在哪里 - How do I restart mysql and where is my.cnf file
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM