[英]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.